Skip to content

Instantly share code, notes, and snippets.

@see-why
Created March 24, 2022 22:19
Show Gist options
  • Save see-why/5435120874aecd06ab635efcc74c959c to your computer and use it in GitHub Desktop.
Save see-why/5435120874aecd06ab635efcc74c959c to your computer and use it in GitHub Desktop.
Hackerrank Game of thrones 1 challenge solution
# https://www.hackerrank.com/challenges/game-of-thrones/problem?isFullScreen=true
def gameOfThrones(s):
# Write your code here
dict = collections.Counter(s)
max_value = max(dict.values())
if(max_value == 1):
return 'NO'
result = 'YES'
counter = 0
for k, v in sorted(dict.items()):
if(v%2 == 1):
counter += 1
if (counter >= 2):
result = 'NO'
break
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment