We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defsuperReducedString(s):# Write your code hereiflen(s)==0:return'EmptyString'eliflen(s)==1:returnselifall([s[i]!=s[j]fori,jinzip(range(len(s)-1),range(1,len(s)))]):returnselse:fori,jinzip(range(len(s)-1),range(1,len(s))):ifs[i]==s[j]:s=s[:i]+s[j+1:]returnsuperReducedString(s)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Super Reduced String
You are viewing a single comment's thread. Return to all comments →
python recursive implementation