@@ -0,0 +1,1996 @@
+import java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A// https://www.hackerrank.com/challenges/ctci-making-anagrams/problem%0Apublic class MakingAnagrams %7B%0A%0A  private static Map%3CCharacter, Integer%3E getCharacterFrequency(String word) %7B%0A    Map%3CCharacter, Integer%3E frequency = new HashMap%3CCharacter, Integer%3E();%0A    for (char character : word.toCharArray()) %7B%0A      int value = frequency.getOrDefault(character, 0);%0A      frequency.put(character, value + 1);%0A    %7D%0A    return frequency;%0A  %7D%0A%0A  private static Character%5B%5D getArrayFromKeys(Map%3CCharacter, Integer%3E map) %7B%0A    Character%5B%5D chars = new Character%5Bmap.keySet().size()%5D;%0A    return map.keySet().toArray(chars);%0A  %7D%0A%0A  private static int getDeletionsToFormAnagram(String firstWord, String secondWord) %7B%0A    int deletions = 0;%0A    Map%3CCharacter, Integer%3E firstFrequencies = getCharacterFrequency(firstWord);%0A    Map%3CCharacter, Integer%3E secondFrequencies = getCharacterFrequency(secondWord);%0A    Character%5B%5D firstChars = getArrayFromKeys(firstFrequencies);%0A    for (char character : firstChars) %7B%0A      int firstValue = firstFrequencies.get(character);%0A      int secondValue = secondFrequencies.getOrDefault(character, 0);%0A      int difference = Math.abs(firstValue - secondValue);%0A      if (secondValue != 0) %7B%0A        secondFrequencies.remove(character);%0A      %7D%0A      deletions += difference;%0A    %7D%0A    Character%5B%5D secondChars = getArrayFromKeys(secondFrequencies);%0A    for (char character : secondChars) %7B%0A      deletions += secondFrequencies.get(character);%0A    %7D%0A    return deletions;%0A  %7D%0A%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) %7B%0A      String firstWord = reader.readLine();%0A      String secondWord = reader.readLine();%0A      int deletions = getDeletionsToFormAnagram(firstWord, secondWord);%0A      System.out.println(deletions);%0A    %7D%0A  %7D%0A%7D%0A

Add solution to Making anagrams problem.