Plz correct my code
longest consecutive subsequence
ur code is correct ,just u need to add some minute changes

here cnt=1 (because element itself will contribute 1)
also in if statement make sure that ur it!=x.begin()
check ur updated code here->
sir we are getting previous element by
- prev(it)
if we want to get next element then what should we we have to write
can u guess it …?
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.