You are viewing a single comment's thread. Return to all comments →
I came to the same on my own. This is my implementation in Python3:
from collections import Counter def gameOfThrones(s): counter = Counter(s) middle = 0 if not len(s) // 2: # even for k,v in counter.items(): if v // 2: return "NO" else: for k,v in counter.items(): if v % 2 == 1: middle += 1 if middle > 1: return "NO" return "YES"
Seems like cookies are disabled on this browser, please enable them to open this website
Game of Thrones - I
You are viewing a single comment's thread. Return to all comments →
I came to the same on my own. This is my implementation in Python3: