DEV Community

loading...

Discussion on: Daily Challenge #259 - Duplicate Encoder

Collapse
boris profile image
Boris Quiroz

🐍

def duplicate(string):
    result = ""
    for s in string.lower():
        if string.count(s) > 1:
            result += ")"
        else:
            result += "("

    print(result)