Longest Subsequence

Company: MS Microsoft_23jan

Difficulty: medium