I have written a code which is giving correct answer to all of my inputs but the codechef IDE keeps showing WA. I think i am missing some cases. How to check for those?
- Read the question atleast 3 times thoroughly. See how each line affects your code.
- Create your own test cases. Delibrately aim to fail your own code. Take cases bordering the constraints(edge cases) .
- Use common sense to check for corner cases.
- In case of debugging, use print statements to print our arrays, or whatever data structure you are using after each step.
- Check for code thoroughly… Each line should be seen properly.
- Even in CP, try to write readable code and indent properly. Trust me, it helps a lot.
i read some questions on this forum. They were telling to use bruteforce technique and a program for random test cases. I want to know the program and how to use it.
You nailed it bro i am totally satisfied with your answer.
Well, I don’t know about such a program.I have search it up.
here he talks about about debugging, check it out