5
1 9 10 11 2
in this acc to bhaiya approach , longest subsequence would be 1,2
but in actual it is 1,9,10,11.
what would you say about this ???
Have a testcase which can prove this wrong
yes this will be the LIS only, haven’t watched the video. You can take reference from my code, i guess he has explained the same.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
i have doubt while reaching at 2 at length[1] wouldn’t 9 get changed by 2 as length[0]<2<length[9]
he has done with dp[length] rather than position and you have implemented with position
Kindly refer to this solution. It might help you out.
Basically in this solution we are trying to find that length of maximum increasing subsequence at each i(0-n-1) and finding max out of that.
Hope this solution clears all your doubts.
Hi, if your doubt was resolved , please mark it resolved
else if u still have any doubt regarding this question, u can post it here : )
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.