vault backup: 2022-07-14 10:09:31

This commit is contained in:
juan 2022-07-14 10:09:31 +08:00
parent ae73cbe6b8
commit bbcd5e02d5

View file

@ -69,6 +69,8 @@ similar to this one.
The goal is making cur as small as possible, without duplicating The goal is making cur as small as possible, without duplicating
And the localMax is max(localMax, i - cur)
### Solution ### Solution
Kadane's algorithm Kadane's algorithm
@ -90,6 +92,7 @@ public:
} }
hMap[s[i]] = i; hMap[s[i]] = i;
// The char at cur is ignored
localMax = max(localMax, i - cur); localMax = max(localMax, i - cur);
} }
return localMax; return localMax;