Shuffled Together — Solution & Editorial
dp[i][j]: can A's first i and B's first j characters weave into C's first i+j? Each state extends from the left or from above on a matching character.
Complexity: O(|A|·|B|)
Watch out: Greedy consuming from whichever string matches first fails when both match — the DP tries both.