improved string longest word made of other words (dfs)