Skip to content

Instantly share code, notes, and snippets.

@jianminchen
Created March 13, 2016 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianminchen/bd3834da7b28ae619ee2 to your computer and use it in GitHub Desktop.
Save jianminchen/bd3834da7b28ae619ee2 to your computer and use it in GitHub Desktop.
HackerRank: Game Throne -
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