PROBLEM STATEMENT
Given two String[]'s , a source list and a word list, you need to find how many
strings in the source list have an anagram in the word list.
Create a class StrAnagram that contains the method numAnagram, which takes two
String[], sourceList and wordList as input and returns the number of strings in
sourceList that have at least one anagram in wordList.
DEFINITION
Class Name: StrAnagram
Method Name: numAnagram
Parameters: String[] String[]
Return type: int
Method Signature( Make sure to make public ): int numAnagram(String[]
sourceList, String[] wordList)
NOTES
- Two Strings are anagrams of each other when one String is a
permutation(reordering the characters) of the other string.
- If two Strings are the same, they are to be considered anagrams of each other.
- All Strings comparisons are case sensitive.
TopCoder will ensure the validity of the inputs. Inputs are valid if all of
the following criteria are met:
- Both sourceList and wordList have 0 to 50 elements (inclusive).
- Each string in both the lists are 1 to 50 characters in length (inclusive).
- All strings in the input contain only the letters('A'-'Z','a'-'z').
EXAMPLES
sourceList = {"ABCD","TopCoder","java"}
wordList = {"CDAB","rTedoopC","pink","DBAC"}
return value = 2
sourceList = {"apple","banana","orange","blueberry","dear"}
wordList = {"apple","blue","read","bblueerry","yrrebeulb"}
return value = 3
sourceList = {"dear","read"}
wordList = {"eard"}
return value = 2
sourceList = {"read"}
wordList = {"eard","dear"}
return value = 1
sourceList ={"abcd"}
wordList = {"DAbc"}
return value = 0