We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Strings
- Game of Thrones - I
- Discussions
Game of Thrones - I
Game of Thrones - I
Sort by
recency
|
1072 Discussions
|
Please Login in order to post a comment
Here is my c++ solution : explanation here : https://youtu.be/yhSaL48IHds
solution 1 :
solution 2 :
for Python3 Platform
string gameOfThrones(string s) { const int range = 'z' - 'a' + 1; size_t pairTable[range] = {0}; for(auto & chr : s) { pairTable[chr - 'a'] ^= 1; } size_t sum = 0; for(size_t idx = 0; idx < range; idx++) { sum += pairTable[idx]; } if((s.length() % 2) == sum) { return "YES"; } return "NO"; }
JAVA
Javascript:
} `