Intersection of two arrays


test cases are failing due to wrong answer , where is my mistake?

https://ide.codingblocks.com/s/586496 i have corrected ur code

what are the changes you did?

this was ur output
image
expected was
image
u can see there is an extra comma and space in ur ans in end… i have corrected that only… rest ur logic was fine…
this was the change i did
image

ok thank you…

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.