Interleaving String

Medium · Dynamic Programming · about 25 minutes

Asked at Google, Amazon, Microsoft, Apple, Bloomberg.

Given strings s1, s2 and s3, return true if s3 can be formed by interleaving s1 and s2: splitting both into pieces and merging the pieces while keeping the characters of each string in their original order.

Related guides