The best subsequence

Company: UIDAI_16dec

Difficulty: medium