What do the test cases check my code for?

When your code is run against test cases, it is checked for the following:

Time that the code takes to run

The code should run within a stipulated time. If it does not, you will see a Time Limit Exceeded (TLE) error.

Memory consumed by the code

The code should run within the given memory size. If it does not, you will see a Memory Limit
Exceeded (MLE) error.

Errors that occur while the code is running

Some test cases are tricky and will only check your code for Runtime Errors (RE). These include syntax errors and compilation errors.

Check whether your code results in a correct answer

If the answer is not correct, you will see a Wrong Answer (WA) error. This means that your program is not printing out the correct answer. To fix this, ensure that your program:

  • Matches the output format that is required
  • Does not print unnecessary information