Your question is Merge Strings While Preserving Order. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given two strings s1 and s2, and a target string s3, determine if s3 can be formed by merging s1 and s2 such that the relative order of characters from s1 and s2 is preserved.
Asked in the Loop Interview Round 1 stage. Solved using recursion and backtracking with memoization after interviewer-provided tips.
Implement is_interleaving(s1, s2, s3), where all inputs are strings. Return True if s3 is a valid interleaving of s1 and s2; otherwise return False.
def is_interleaving(s1, s2, s3):