Skip to content

Commit 646a190

Browse files
authored
1461
1 parent db55cd2 commit 646a190

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution {
2+
public boolean hasAllCodes(String s, int k) {
3+
Set<String> set = new HashSet<>();
4+
for (int i = 0; i <= s.length() - k; i++) {
5+
set.add(s.substring(i, i + k));
6+
}
7+
return set.size() == Math.pow(2, k);
8+
}
9+
}

0 commit comments

Comments
 (0)