Common Digit Longest Subsequence— Asked in Amazon Interview

Problem Statement :

7
11 122 77 92 55 69 98
5

Approach :

Space Optimized DP

Code :

Thanks for Reading