Dashboard
LC #97

Interleaving String

Pattern · ?GoogleAmazonBloomberg

Problem

Check if s3 is formed by interleaving s1 and s2 while preserving their relative order.

Constraints

  • 0 ≤ s1.length, s2.length ≤ 100
  • s3.length == s1.length + s2.length

Example

Input
s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"
Output
true
Why
s3 interleaves s1 and s2 preserving their relative orders

Spot the pattern

Which pattern cracks it?

Hints

One at a time
Solve on LeetCode ↗