You are viewing a single comment's thread. Return to all comments →
Your code is very nice, but I think that overall complexity is quite high - O(n*n) - when compared to a simpler albeit more verbose approach:
S = raw_input() K =int(raw_input()) temp = [] len_temp = 0 for item in S: len_temp += 1 if item not in temp: temp.append(item) if len_temp == K: print ''.join(temp) temp = [] len_temp = 0
Seems like cookies are disabled on this browser, please enable them to open this website
Merge the Tools!
You are viewing a single comment's thread. Return to all comments →
Your code is very nice, but I think that overall complexity is quite high - O(n*n) - when compared to a simpler albeit more verbose approach: