In the brute-force solution, shouldn’t the time complexity be O(2^(m + n)) instead of just O(2^m) and the space complexity O(m + n) instead of just O(m)?
Course: Grokking Dynamic Programming Patterns for Coding Interviews - Learn Interactively
Lesson: Subsequence Pattern Matching - Grokking Dynamic Programming Patterns for Coding Interviews