logoalt Hacker News

gaya3bollinenitoday at 6:19 PM1 replyview on HN

how do you keep the local test cases in sync when the original problems or test cases change?


Replies

therepanictoday at 6:27 PM

LeetCode problems are usually added after each contest, and as far as I know their statements generally don't change afterward at least the actual problem itself doesn't.

As for test cases, there are occasionally solutions that are technically incorrect but still pass because a particular edge case isn't covered. We maintain our own test cases, including a DSL for writing large stress tests, and try to cover all possible cases.

In the worst case, a solution might pass our local tests but fail on LeetCode. I expect such cases to be rare and one of the benefits of having the tests open is that when someone finds a missing case, it can be added so nobody else runs into the same issue.