You are viewing a single comment's thread. Return to all comments →
My java 8 solution
List<String> magazineWords = Arrays.stream(magazine).sorted().collect(Collectors.toList()); boolean notRemovedWord = Arrays.stream(ransom).anyMatch(word->!magazineWords.remove(word)); System.out.println(notRemovedWord ? "No" : "Yes");
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
My java 8 solution