• + 0 comments
    #python
    from collections import Counter
    def happyLadybugs(b):
        c=Counter(b).items()
        for x in c:
            if x[0]!='_' and x[1]==1:
                return "NO"
        if '_' not in b:
            for i in range(len(b)-1):
                if b[i]==b[i+1] or b[i]==b[i-1]:
                    continue
                else:
                    return "NO"
        return "YES"