We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b7d3b4 commit 734cb40Copy full SHA for 734cb40
src/main/java/com/fishercoder/solutions/_1461.java
@@ -5,6 +5,9 @@
5
6
public class _1461 {
7
public static class Solution1 {
8
+ /**
9
+ * inspired by https://leetcode.com/problems/check-if-a-string-contains-all-binary-codes-of-size-k/discuss/660505/Java-4-lines-solution
10
+ */
11
public boolean hasAllCodes(String s, int k) {
12
Set<String> set = new HashSet<>();
13
for (int i = 0; i <= s.length() - k; i++) {
0 commit comments