what is it that i am doing wrong?
can u point out the error. i read this concept from gfg.
ide->https://ide.codingblocks.com/s/257925
ques->https://www.interviewbit.com/problems/length-of-longest-subsequence/
what is it that i am doing wrong?
can u point out the error. i read this concept from gfg.
ide->https://ide.codingblocks.com/s/257925
ques->https://www.interviewbit.com/problems/length-of-longest-subsequence/
Hello Imran, the issue is that you are also considering equal elements in you subsequence.
Suppose the input is
5
5 5 5 5 5
Then your code will give ans 5 although the ans will be 1. So pls remove equal to condition.
I hope it is clear to you. In case it is clear to you pls mark it as resolve and provide the rating as well as feedback so that we can improve ourselves.
In case there is still some confusion pls let me know, I will surely try to help you out.
Thanks 
Happy Coding !!
ok have you made the changes in the same by removing the equal to sign or anything else also you have done
Please have a look at this I have made some changes in your code and commented that hope you will understand this. And you were considering substring rather than subsequence.
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.