Checking others’ solutions I noticed that many took the approach of going through the dictionary to get the first highest valued word that could be wirtten with the given letters.
While this is fine for the CodinGame practice, I took another approach thinkinga about the real scrabble game. In that case, the dictionary would have been fixed once for all and the cost of seting it up doesn’t matter (as it can be done once for all before any game). The problem, then, would be to check as fast as possible all the possible word against the dictionary.
This means spending only log(N) to search into the dictionary rather than N.
I solved it using this approach and I wonder if anyone did the same or rejected it for some reason.
I only checked some of the C solutions as I only did it in C.
(Of course I do not go through all the 1 * 7! +7 * 6! +21 * 5! + 35 * 4! + 35 * 3! + 21 * 2! + 7 words! )