Find all elements with two frequency

My Code is giving wrong output

hello @basitakram4

a) declared array with size n+1 (because we want to acces index n as well)
b) u were pushing arr[i] but it might possible that arr[i] is negative so added abs(arr[i])
c) it might happen that there is no element with frequency 2 thats why added if statement while printing output to avoid run error

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.