I’m not able to figure out why the following code isn’t passing the test cases. I tried the code on my local machine, and it seemed to pass the custom cases.
Link to the problem: https://hack.codingblocks.com/contests/c/380/1559
Link to the code: https://ide.codingblocks.com/s/48862
Exist_or_not Problem
Hey Harsh, there are 2 corrections in your code
- declare
unordered_map<ll, ll> m;insidewhile(t--)loop. - Put an if check
if(q>=0)beforewhile (q--)loop.
1 Like
why the second condition?
Hey Shikhar, there i a case in which q < 0, for that we are putting this condition.