Skip to content

Commit cf7d1c3

Browse files
refactor 291
1 parent dfb7c3b commit cf7d1c3

File tree

1 file changed

+1
-15
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-15
lines changed

src/main/java/com/fishercoder/solutions/_291.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@
55
import java.util.Map;
66
import java.util.Set;
77

8-
/**
9-
* 291. Word Pattern II
10-
*
11-
* Given a pattern and a string str, find if str follows the same pattern.
12-
* Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty substring in str.
13-
14-
Examples:
15-
pattern = "abab", str = "redblueredblue" should return true.
16-
pattern = "aaaa", str = "asdasdasdasd" should return true.
17-
pattern = "aabb", str = "xyzabcxzyabc" should return false.
18-
19-
Notes:
20-
You may assume both pattern and str contains only lowercase letters.
21-
*/
228
public class _291 {
239

2410
public static class Solution1 {
@@ -30,7 +16,7 @@ public static class Solution1 {
3016
* "a" matches "red"
3117
* "b" matches "blue"
3218
* then we'll just finish the str check based on this pattern
33-
* */
19+
*/
3420
public boolean wordPatternMatch(String pattern, String str) {
3521
Map<Character, String> map = new HashMap();
3622
Set<String> set = new HashSet();

0 commit comments

Comments
 (0)