Longest Consecutive Subsequence Error

I have got an error in the code but I don’t get the error.

Hey @Kinjal
In line 10 add curly braces

m.insert({a[i],m[a[i]]++})

Also at line 16 use

m.count(i)>0 // instead of at

Your code is correct but not time efficient

Thanks bhaiya.

Yeah, I got your point that it’s not time efficient. Although, it’s a brute force approach.