BNY interview question

Asked about the subsequence question