Contains Duplicate Leetcode : Runtime Error

Passing on sample cases:

But when I’m submitting it’s showing runtime error?

Edit: Problem is resolved thanks!!

Code : Solution.cpp

hey, put custom input as [] this empty array and see what you get?

tried that too, compiler is taking only vector type values.

put for v.size()==0 return false
Capture

If its showing runtime error then maybe you have to do it in less than O(nlogn) time complexity, since you’re sorting it, it takes O(nlogn).

yeah , i was missing that case. thanks