Earning Correctness( I/O) Badge
This article gives you pointers on how to earn the Correctness badge.
Before anything else, the code should work. Every Geektrust solution should be able to pass a set of positive and negative test cases. Handling all the edge cases, and making sure the code passes all tests is the first step towards earning the correctness badge.
When you run tests on your code via Geektrust, we run a few positive and negative test cases and tell you if it broadly passes the checks. When you finally submit your code, we will run more scenarios to check if your logic is comprehensive. Not all test cases will be made visible to you. It is, after all, a test. But if you've understood the logic, this should be the easiest badge to get!
The usual suspects - Common pitfalls while earning correctness badge
1. Not following I/O instructions
All input commands should be read from a text file, and output should be printed to the console. The text file will contain commands in the format prescribed by the coding problem. Failing to follow these instructions will result in not earning the correctness badge.
2. Not covering negative test cases
We run an extensive set of positive and negative test cases on your code to check the thoroughness of your logic. Read through the sample I/O thoroughly. Run tests on your code before submitting, and check where it is failing. Correct your logic accordingly.
3. Hardcoding I/O
Hardcoding the expected output for specific input commands is a big indicator that you haven't been able to solve the coding problem. If we detect an attempt to hardcode one or more test cases, you will be given a correctness score of 0 and your overall Geektrust score will also be set to 0.