while I'm looking at the solutions presented here, I tried to understand your solution knowing that you have often a different and interesting view of looking at the problem. I did a litte test case dict:
ffffffff fffffffa afffffff bfffffff fffffffb ffffbfff
With this dict the letters to choose to get the most matching words is 'bfffffff'. You algorithm prints something different. What have I missed?