Hello I am getting TLE using Memorization in Recursion. Please see the image for my though process.
S1, S2 are subsequences and their values. The idea is to branch out based on the current value of the input array item
https://codeforces.net/1332ab/thinking.PNG
Thank you