Description:
Solution:
count will store the number of letters of each chracters.
res is the longest length of substring we can have.
There will be two pointers: r, l
Moving r pointer, we count the character.
If the length(substring) - (count of bigger character) is bigger than k, we should move l pointer.
Then, update the max res.
Time Complexity: O(n)
'LeetCode ๐๏ธ > String' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
20. Valid Parentheses (0) | 2023.06.18 |
---|---|
49. Group Anagrams (0) | 2023.06.17 |
242. Valid Anagram (0) | 2023.06.16 |
76. Minimum Window Substring (0) | 2023.06.15 |
3. Longest Substring Without Repeating Characters (0) | 2023.06.13 |