Why my solution gives wrong answer for all test cases . It will run on all small cases,
Hey Perul
You have a loop for processing Q queries in the end while there is only one query for a testcase. Try removing the Q query loop.
Hey Perul
You have a loop for processing Q queries in the end while there is only one query for a testcase. Try removing the Q query loop.