rewrite leetcode substring with concatenation of all words