Exist or not hashing

why i m getting all test cases fail here…?

Hi @nikhilmeena

You need to declare map differently for each test case, hence declare it inside the loop of test cases. Also declare array of size n after taking input of n else array would be made of size of value which is stored in n which is the garbage value.

corrected code : https://ide.codingblocks.com/s/206596

Hope it helps.

@nikhilmeena
Please mark your doubt as resolved.

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.