Longest consecutive subsequence

problem:>>>

plz do corrections in my code only don’t want to mug up new solution I am doing using unordered_map as prateek bhaiya taught but guess repeating numbers causing issue
my code given below plz make corrections with comments >>>>

Hey @coderajay03

            else if(map.count(no-1) && map.count(no+1)){
                int len1=map[no-1];
                int len2=map[no+1];
                int new_len=len1+1+len2;
                map[no-len1]=new_len;
                map[no]=new_len;  //Add this here so that next time this element comes it doesn't cause an issue
                map[no+len2]=new_len;
            }

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.