Given strings `s1`, `s2`, and `s3`, find whether `s3` is formed by an interleaving of `s1` and `s2`. An interleaving of two strings `s` and `t` is a configuration where they are divided into non-empty substrings such that `s3` is formed by joining them in order.
2D Dynamic Programming
We use a 2D boolean array `dp[i][j]` to represent whether `s3[0...i+j-1]` can be formed by interleaving `s1[0...i-1]` and `s2[0...j-1]`. To calculate `dp[i][j]`, we check if the current character `s3[i+j-1]` matches `s1[i-1]` (and `dp[i-1][j]` was true) OR if it matches `s2[j-1]` (and `dp[i][j-1]` was true).