@@ -0,0 +1,1882 @@
+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-ransom-note/problem%0Apublic class RansomNote %7B%0A%0A    private static final String NO = %22No%22;%0A    private static final String YES = %22Yes%22;%0A    private static final String SPACE = %22 %22;%0A%0A    private static String%5B%5D readWords(BufferedReader reader) throws IOException %7B%0A        return reader.readLine().split(SPACE);%0A    %7D%0A%0A    private static Map%3CString, Integer%3E getFrequencies(String%5B%5D words) %7B%0A        Map%3CString, Integer%3E frequencies = new HashMap%3C%3E();%0A        for (String word : words) %7B%0A            int frequency = frequencies.getOrDefault(word, 0);%0A            frequencies.put(word, frequency + 1);%0A        %7D%0A        return frequencies;%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            reader.readLine(); // Skip first line.%0A            String%5B%5D magazineWords = readWords(reader);%0A            String%5B%5D noteWords = readWords(reader);%0A            if (noteWords.length %3E magazineWords.length) %7B%0A                System.out.println(NO);%0A                return;%0A            %7D%0A            Map%3CString, Integer%3E magazineFrequencies = getFrequencies(magazineWords);%0A            Map%3CString, Integer%3E noteFrequencies = getFrequencies(noteWords);%0A            for (String noteWord : noteFrequencies.keySet()) %7B%0A                int noteFrequency = noteFrequencies.get(noteWord);%0A                int magazineFrequency = magazineFrequencies.getOrDefault(noteWord, 0);%0A                if (noteFrequency %3E magazineFrequency) %7B%0A                    System.out.println(NO);%0A                    return;%0A                %7D%0A            %7D%0A            System.out.println(YES);%0A        %7D%0A    %7D%0A%7D%0A

Add solution for Ransom note problem.