1
AnonymousAnon
wrote my own test cases before looking at the leetcode examples and started catching my own bugs way earlier
#dsa#learning
Used to jump straight to coding after reading the prompt once, then debug against whatever examples were given. Started forcing myself to write two or three edge cases in plain English first, empty input, single element, duplicates. Catches assumptions I didn't know I was making before a single line of code exists.
1 comment
- 0
AnonymousAnon Started doing this after getting burned by an empty array assumption in an interview and it's saved me more times than I expected. Cheap habit for how much it catches.