Longest consecutive subsequence (Unordered map)

why do not you update the length of number in else part
(the last condition in the code)?
it should be …m[no]=len+1;
but in the code it just m[no]=len;

second question sir ,if the array contains duplicate like
{ 1,2,3,3,4}, then the length should be 4 (we just count one of the threes) or 5(count it)??

hello @mzk1994

yeah that should be len+1 , in later part of video bhaiya corrected it.

it will remain 4, we dont count repetetion

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.