You are viewing a single comment's thread. Return to all comments →
Ah, the sugar! Let's go deeper, shall we? :)
public static int numberNeeded(String first, String second) { int[] freq = new int[26]; first.chars().forEach(c -> freq[c - 'a']++); second.chars().forEach(c -> freq[c - 'a']--); return Arrays.stream(freq).map(Math::abs).sum(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →
Ah, the sugar! Let's go deeper, shall we? :)