How to check for corner cases?

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?

1 Like

General Help:

  1. Read the question atleast 3 times thoroughly. See how each line affects your code.
  2. Create your own test cases. Delibrately aim to fail your own code. Take cases bordering the constraints(edge cases) .
  3. Use common sense to check for corner cases.
  4. In case of debugging, use print statements to print our arrays, or whatever data structure you are using after each step.
  5. Check for code thoroughly… Each line should be seen properly.
  6. 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

1 Like