I have got an error in the code but I don’t get the error.
Longest Consecutive Subsequence 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.