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 887b8d9 commit ca66ab0Copy full SHA for ca66ab0
longest-repeating-character-replacement/seungriyou.py
@@ -5,7 +5,7 @@ def characterReplacement(self, s: str, k: int) -> int:
5
"""
6
[Complexity]
7
- TC: O(n)
8
- - SC: O(n)
+ - SC: O(1) (* s consists of only uppercase English letters)
9
10
[Approach]
11
two pointer로 sliding window를 이동해가면서, k번 이내로 replace 했을 때 모두 같은 문자가 될 때의 max_len를 트래킹하면 된다.
0 commit comments