- Note: normally 2) and 3) are in reversed order; this problem is a bit different - This is efficient when the number of characters is not limited to 26, the runtime is still O(m + n) ...
Explanation: s2 contains one permutation of s1 ("ba"). The input strings only contain lower case letters. The length of both given strings is in range [1, 10,000]. Hide Hint #1 Obviously, brute force ...