LeetCode 30 - Substring with Concatenation of All Words - Python