Output format is not clearly mentioned. Only one test case is passed.please help me getting AC.
Find All Elements With Frequency Zero
Hey, i think your logic is incorrect as well.This is the right code.
vector ret;
for(int i = 0; i < nums.size();i++) {
if(nums[abs(nums[i])-1] < 0) ret.push_back(abs(nums[i]));
else nums[abs(nums[i])-1] *= -1;
}
return ret;
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.