EY interview question

To find longest Subsequence in python.