-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bb2bba
commit 6f6e017
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @Company Facebook | ||
* | ||
* Given two strings, str and pattern, return true if the str has a valid mapping between the words in str and the characters in the pattern. | ||
* The str will be whitespace separated and the pattern will be depicted using characters. | ||
* | ||
* Problem Ex. | ||
* Input: 'cat dog dog cat', 'abba' | ||
* Output: true because cat = a and dog = b. | ||
* | ||
* Input: 'cat dog dog foo', 'abba' | ||
* Output: false because cat = a so foo cannot == a | ||
*/ | ||
public boolean isValidPattern(String str, String pattern) { } |