@@ -0,0 +1,2424 @@
+package algorithms.strings;%0D%0A%0D%0Aimport java.util.*;%0D%0A%0D%0A/*%0D%0A * Problem Statement: %0D%0A * Dothraki are planning an attack to usurp King Robert's throne. King Robert%0D%0A * learns of this conspiracy from Raven and plans to lock the single door%0D%0A * through which the enemy can enter his kingdom.%0D%0A * But, to lock the door he needs a key that is an anagram of a certain%0D%0A * palindrome string.%0D%0A * %0D%0A * The king has a string composed of lowercase English letters. Help him figure%0D%0A * out whether any anagram of the string can be a palindrome or not.%0D%0A * %0D%0A * Input Format:%0D%0A * A single line which contains the input string.%0D%0A * %0D%0A * Constraints:%0D%0A * 1 %3C= length of string %3C= 105%0D%0A * Each character of the string is a lowercase English letter.%0D%0A * %0D%0A * Output Format:%0D%0A * A single line which contains YES or NO in uppercase.%0D%0A * %0D%0A * Sample Input: 01%0D%0A * aaabbbb%0D%0A * %0D%0A * Sample Output: 01%0D%0A * YES%0D%0A * %0D%0A * Explanation%0D%0A * A palindrome permutation of the given string is bbaaabb.%0D%0A * %0D%0A * Sample Input: 02%0D%0A * cdefghmnopqrstuvw%0D%0A * %0D%0A * Sample Output: 02%0D%0A * NO%0D%0A * %0D%0A * Explanation%0D%0A * You can verify that the given string has no palindrome permutation.%0D%0A * %0D%0A * Sample Input: 03%0D%0A * cdcdcdcdeeeef%0D%0A * %0D%0A * Sample Output: 03%0D%0A * YES%0D%0A * %0D%0A * Explanation%0D%0A * A palindrome permutation of the given string is ddcceefeeccdd.%0D%0A */%0D%0Apublic class GameOfThronesI %7B%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        Scanner sc = new Scanner(System.in);%0D%0A        String inputString = sc.nextLine();%0D%0A        %0D%0A        String ans;%0D%0A        %0D%0A        Map%3CCharacter, MutableInt%3E map = new HashMap%3C%3E();%0D%0A        for (int i = 0; i %3C inputString.length(); i++) %7B%0D%0A        %09MutableInt count = map.get(inputString.charAt(i));%0D%0A        %09%0D%0A        %09if (count == null) %7B%0D%0A        %09%09map.put(inputString.charAt(i), new MutableInt());%0D%0A        %09%7D else %7B%0D%0A        %09%09count.increment();%0D%0A        %09%7D%0D%0A        %7D%0D%0A        %0D%0A        int numOddCounts = 0;%0D%0A        for (Character c : map.keySet()) %7B%0D%0A        %09if (map.get(c).value %25 2 == 1) %7B%0D%0A        %09%09numOddCounts++;%0D%0A        %09%7D%0D%0A        %7D%0D%0A        %0D%0A        if (numOddCounts %3C= 1) %7B%0D%0A        %09ans = %22YES%22;%0D%0A        %7D else %7B%0D%0A        %09ans = %22NO%22;%0D%0A        %7D%0D%0A        System.out.println(ans);%0D%0A        sc.close();%0D%0A    %7D%0D%0A%7D%0D%0A%0D%0Aclass MutableInt %7B%0D%0A%09  int value = 1; // note that we start at 1 since we're counting%0D%0A%09  public void increment () %7B ++value;      %7D%0D%0A%09  public int  get ()       %7B return value; %7D%0D%0A%7D

Add GameOfThronesI