sir i’m getting TLE in one of the test case
please tell me how to correct it
here is my code https://ide.codingblocks.com/s/59641
TLE in exist or not(hashing)
Hey Rahul, update your code’s line:19 like this while(q-->0)
@sanjeetboora Faced the same issue, my question is HOW DOES THAT WORK? doesn’t while loop stop when q-- automatically reaches zero?
Hey Lakshay, yes that’s right while loop stop when q-- automatically reaches zero from a positive number because in C++ 0 is treated as false, but it will leads to an infinite loop if q is negative because in C++ -ve is treated as true and q-- will never reach 0 then.
2 Likes