This is Longest Common Subsequence from LeetCode. Given two strings, find the length of their longest common subsequence. For "abcde" and "ace", the LCS (Longest Common Subsequence) is "ace" with length 3.
A common subsequence appears in both strings in the same order, but not necessarily contiguously. What decisions do you make at each position? Read the problem statement carefully, noting the constraints. Try to identify the recursive structure before looking at the solution.