LeetCode: substring of concatenation, divide