about | help | code help+videos | done | prefs |
(MEDIUM) Given an input String and an ArrayList of other Strings to check against, calculate and return how many of the other Strings are anagrams of the input. Anagrams, remember, have all the same letters but in potentially different orders - spaces are not considered. Precondition: all the Strings in this problem have only lowercase letters and spaces in them. HINTS: The spaces really don't matter. Maybe they don't even need to be there? Also the order of letters really doesn't matter here either. CHALLENGE: solve with regular expressions, or with stream processing!apcsaCountAnagrams("hello world", ["howled roll", "rolled howl", "goodbye world", "lewd oh roll", "hello door"]) → 3 apcsaCountAnagrams("finders keepers", ["losers weepers", "finders keepers", "redefines perks", "repressed knife", "finders keep hers", "defense per risk"]) → 4 apcsaCountAnagrams("infections wormholes", ["reinfection howl moss", "semicolons for the win", "eat at joes crabshack", "enrichments of you", "enrichments woof soil"]) → 3 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 330
Copyright Nick Parlante 2017 - privacy