Closed aravindsrivats closed 9 years ago
We are using a anagram map to store the words @asrayousuf @aravindram94 so that we don't have to compare the same words twice.
@aravindsrivats : The key should be the sorted lettered word!
Yes. That will be the key. The value will be a list of words and the score.
@aravindsrivats : At which position is the score going to be?
I'll return you the Word object in which, the word will be each word separated by spaces and score as its common score.
@aravindsrivats : Why a space separated list? You can have a list. It becomes easier to compute.
Compute what? The score is going to be calculated using the key.
@aravindsrivats : is there an element names score in the object? Or is it going to be appended to the list in the map?
This is the final structure. Map < String, String>
Key will be sorted word.
Value will be "score anagram1 anagram2 anagram3 . . "
If there is no anagram
Value will be "score"
It cant be . bcoz after sorting u lose the word . so u cant store the score alone
Sorry. It will be "score word"
But the whole point is why do u bother about the traversing the list ! it is a performance issue man! So performance doesnot matter...
Its not about performance. Its about stupidity. Why go over the same set of characters again and again?
okay!
can v discuss about the signature of the function?
Map of the following structure is generated. Map <String, String>
Creating the anagram map from the dictionary file to store all words in the format: key = anagram string ; value = all possible strings with that anagram