Hey everyone,
When I first started LeetCoding, I had a terrible habit: I would write out my logic, immediately hit the "Submit" button, and then get frustrated by a "Wrong Answer" or "Time Limit Exceeded" error.
Over time, I realized that top competitive programmers rarely do this. They have a mental checklist they run through before submitting. I compiled my own checklist, and it has drastically reduced my submission errors and helped me think like a real interviewer is watching.
Here is the checklist I use now:
Before writing code, check the constraints at the bottom of the problem.
[] or ""?NullPointerException or out-of-bounds error on these?long (Java/C++) to prevent overflow?false, -1, or empty. Make sure your loops exit correctly and don't get stuck infinitely.What about you guys? Is there a specific edge case or rule you always check before hitting that submit button? Let’s build a master checklist in the comments!