Longest increasing subsequence

question
https://practice.geeksforgeeks.org/problems/longest-consecutive-subsequence/0#

code

It fails for few test case whereas logic is correct. Am I missing something?

hello @div_yanshu07

check now->