Game of Thrones - I

  • + 0 comments

    for Python3 Platform

    import collections
    
    def gameOfThrones(s):
        d = collections.Counter(s)
        multipleOddVal = False
        
        for val in d.values():
            if (val % 2 == 1):
                if (multipleOddVal):
                    return "NO"
                    break
                else:
                    multipleOddVal = True
        else:
            return "YES"
    
    s = input()
    
    result = gameOfThrones(s)
    
    print(result)