UNLOCK Shekhar is a bomb defusal specialist. He once encountered a bomb that can be defused only by a secret code. He is given a number N and a number K. And he is also given

my code is not compiling i couldnot know whats the error is please make this code run.

@amanm2292 hey aman you can change this like this to remove the error
m[a[i]]=i;
or
m.insert(make_pair(a[i],i));
to remove the error.

i have tried the first option already

but now it is giving runtime error
is this program taking much time?

@amanm2292 you’re in wrong direction I can help you with the hint usually hash map question is designed with large test cases. so this is the reason the code taking so much time or input is not process well this could be another reason.

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.