Interleaving String
Return true if s3 is formed by interleaving s1 and s2.
Examples
Input: ["aabcc","dbbca","aadbbcbcac"]
Output: true
Input: ["aabcc","dbbca","aadbbbaccc"]
Output: false
Hints
Use a 2D DP table where `dp[i][j]` represents whether the first `i+j` characters of `s3` can be formed by interleaving the first `i` characters of `s1` and the first `j` characters of `s2`.
Initialize the DP table with `dp[0][0] = true` (empty strings interleave to empty string) and fill the first row/column by checking if `s3` matches `s1` or `s2` when one string is exhausted.
For each cell `dp[i][j]`, set it to `true` if either:
Related Problems
Interleaving String
Return true if s3 is formed by interleaving s1 and s2.