Help me find the logical error in unique number III problem

at line no 32
ans=count[i]*p;
instead of this
correct statement will be

ans+=count[i]*p;

if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved :grinning: