Solve "Substring with Concatenation of All Words"