src.longest_subs_no_repeat¶
Classes
|
- class src.longest_subs_no_repeat.Solution[source][source]¶
- lengthOfLongestSubstring(s: str) int[source]¶
Thought process¶
Basic sliding window concept
We move
lleft if we notice a repeated letters[r]untill the condition is no longer violatedIf the repeated condition is not violated
lis stationary marking the start of our substring and we grow the sliding window from the right side withrTwo key things to know here are : sliding window approach with left and right pointers sliding across our array, character map
Notes¶
time complexity : \(O(n)\)
space complexity : \(O(n)\) because of
subshashset