Closed aravindsrivats closed 9 years ago
Algorithm to find the words
for each word in dictionary: take first letter of rack if letter found in word remove letter from word and rack if word is empty possible_word.add(current word)
For blank spaces the algorithm is gonna work like this:
for each word in dictionary: take first letter of rack if letter found in word remove letter from word and rack if remaining length of word is equal to the number of blank spaces possible_word.add(current word)
and where does anagram come into the scene.. now you search only the key of the anagram lis? and then add all the words that are there in the value?
Exactly. You dont need to check for each of the values!
We'll get the input from the second team module as (rack, number of blank spaces)
Or we can have two overloaded functions
Aravind ! if the second passes that to us wat wil they do?
We'll return the score of the word including the blank tile. They'll return the proper score after subtracting the scores of blank tiles.
okay!
what sld i do now?
can v discuss the function signature?
The function receives the rack and number of blanks as input and returns the list of possible words in an ArrayList as output is done
Compare and find all possible words from the anagram map for the particular input rack