I have been learning Groovy for a week, but I have a problem: I need to store the combinations of words to the corresponding ascii values. For example the combinations of the word “the” and the sum of the ascii values of each characters is 10(not exactly,but still for example).
There are, obviously, other words where the sum of ascii values is 10. I want a data structure where I can look up the value 10 and get the words where the sum of the ascii values is 10. I can’t do this in Groovy Map, because the key value should be unique. How to do this in Groovy?
You could do something like this as well:
That gives you the map: