Interleaving Strings

hard
Unit 21 · Dynamic Programming III0/0 to milestone

Return whether s3 can be formed by interleaving s1 and s2: merging them while keeping each string's characters in order. Use a DP over prefixes, with O(len(s2)) space.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Interleaving Strings · TechGradify