Nice explaination , i think we can simplify this even more: class Solution: def compressedString(self, word: str) -> str: n = len(word) i = 0 res = "" while i < n: cnt = 0 start = i while i < n and word[start] == word[i] and cnt < 9: i+=1 cnt+=1 res += str(cnt) + word[i-1] return res
@BananaButcher18 күн бұрын
good one sir, thank you
@devmahad18 күн бұрын
thanks :)
@techdose4u18 күн бұрын
welcome
@amanqureshi322218 күн бұрын
string compressedString(string word) { string ans=""; int l=0,r=0; int count=0; while(r