We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36afaeb commit cdd47aaCopy full SHA for cdd47aa
src/dymanicProgramming/LongestSubstringWithoutRepChars.java
@@ -24,7 +24,7 @@ public static void main(String[] ss) {
24
List<String> strings1 = new ArrayList<String>();
25
map[s.charAt(0)]=0;
26
for (int k = 1; k < s.length(); k++) {
27
- if (map[s.charAt(k)]< k && map[s.charAt(k)] > start) {
+ if (map[s.charAt(k)] >= start) {
28
if (k - start >= length) {
29
length = k - start;
30
Iterator<String> stringIterator = strings1.iterator();
@@ -38,6 +38,7 @@ public static void main(String[] ss) {
38
}
39
int num = map[s.charAt(k)];
40
start = num + 1;
41
+
42
43
map[s.charAt(k)]=k;
44
0 commit comments