Super Reduced String

  • + 0 comments

    Only three lines: Some practices in Hackerrank seem more difficult than easy and somes seem easier than intermediate.

    def superReducedString(s): # Write your code here

    for letter in s:
        s = s.replace(2*letter,"")
    
    return s if len(s) != 0 else "Empty String"