@@ -0,0 +1,2150 @@
+/*%0AAlice is taking a cryptography class and finding anagrams to be very useful. We consider two strings to be anagrams of each other if the first string's letters can be rearranged to form the second string. In other words, both strings must contain the same exact letters in the same exact frequency For example, bacdc and dcbac are anagrams, but bacdc and dcbad are not.%0A%0AAlice decides on an encryption scheme involving two large strings where encryption is dependent on the minimum number of character deletions required to make the two strings anagrams. Can you help her find this number?%0A%0AGiven two strings,  and , that may or may not be of the same length, determine the minimum number of character deletions required to make  and  anagrams. Any characters can be deleted from either of the strings.%0A%0AThis challenge is also available in the following translations:%0A%0AChinese%0ARussian%0AInput Format%0A%0AThe first line contains a single string, . %0AThe second line contains a single string, .%0A%0AConstraints%0A%0AIt is guaranteed that  and  consist of lowercase English alphabetic letters (i.e.,  through ).%0AOutput Format%0A%0APrint a single integer denoting the number of characters you must delete to make the two strings anagrams of each other.%0A%0ASample Input%0A%0Acde%0Aabc%0A%0ASample Output%0A%0A4%0A*/%0A%0Aimport java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0Apublic class Solution %7B%0A    public static int numberNeeded(String first, String second) %7B%0A        char%5B%5D firstArr = first.toCharArray();%0A        char%5B%5D secondArr = second.toCharArray();%0A        %0A        int%5B%5D alphabet = new int%5B'z' - 'a' + 1%5D;%0A        %0A        for(char c : firstArr) %7B%0A            alphabet%5Bc - 'a'%5D++;%0A        %7D%0A        %0A        for(char c : secondArr) %7B%0A            alphabet%5Bc - 'a'%5D--;%0A        %7D%0A        %0A        int sum = 0;%0A        for(int d : alphabet) %7B%0A            sum += d %3C 0 ? -d : d;%0A        %7D%0A        %0A        return sum;%0A    %7D%0A  %0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        String a = in.next();%0A        String b = in.next();%0A        System.out.println(numberNeeded(a, b));%0A    %7D%0A%7D%0A

Making anagrams