Created
March 13, 2016 05:03
-
-
Save jianminchen/bd3834da7b28ae619ee2 to your computer and use it in GitHub Desktop.
HackerRank: Game Throne -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
class Solution | |
{ | |
static void Main(String[] args) | |
{ | |
string input = Console.ReadLine(); | |
int[] count = new int[26]; | |
foreach (char c in input) | |
count[c - 'a']++; | |
int odd = 0; | |
for (int i = 0; i < 26; i++) | |
if (count[i] % 2 == 1) odd++; | |
if (odd <= 1) | |
Console.WriteLine("YES"); | |
else | |
Console.WriteLine("NO"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment