"Accepted!" then "Wrong Answer." How to view all test cases?

Leetcode has a frustrating bug where it says "Accepted" all the time in the code editor but it fails on submit. Can you guys please fix it?

If you can't/won't fix it, then we need way to simply view all test cases we are trying to solve for manually. For some problems, there's no way to use common sense to guess which edge cases to cover until you watch it fail.

An example from recent memory is twoSum - where the instructions give the example of [2, 7, 11, 15] and a target value of 9. The answer is [0, 1] - values at those indices (2 and 7) add to 9, but they just so happened to be adjacent in the example, and you can't see the test cases. Are they always adjacent or not? You'll never know until you submit the answer first and see if it fails. If you make the assumption to add adjacent values to equal the target value, you set off on a totally different path than if you assume that they aren't. The data doesn't have context to what it represents, so you can't use common sense to make assumptions. The first time I did this problem it said "Accepted!" when I ran the code (false positive) it wasn't passing code, only when I submitted it did I see that it tests for totally different things as well. I did better solutions since then that cover all cases (one more readable, one more performant) and shared my work over there, but it still seems like a broken approach to have to guess and check in the dark, not realistic at all.

Suggestion: Fix the indicator bug or let us see the test cases like we would in real life.

Comments (2)