Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Does anybody have an edge case where you need to set windowStart like thiswindow...

Joshua Causey

Mar 22, 2022

Does anybody have an edge case where you need to set windowStart like this windowStart = Math.max(windowStart, map[rightChar] + 1

Because if I just set it to map[rightChar] + 1 it works for every case I have. Really want to understand this. Even just an example string I could debug would be great ❤️

1

0

Comments
Comments
J
Joshua Causey4 years ago

I found a test case to debug and understand. Use "abba" as an input and the output should be 2. Now I get it 🙌

On this page