Interleaving strings
Mediumdynamic programmingstring
Return true if s3 can be formed by taking all the letters of s1 and s2, each in its own order, interleaved together.
Example 1
Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac" Output: true
Example 2
Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbbaccc" Output: false
Constraints
- 0 ≤ s1.length, s2.length ≤ 100
- 0 ≤ s3.length ≤ 200
- Lowercase letters
Submit checks your solution against 10 tests, including hidden ones.
/**
* @param {string} s1
* @param {string} s2
* @param {string} s3
* @return {bool}
*/
function isInterleave(s1, s2, s3) {
}