I recently voted to close this question:
The longest subsequence with specified difference between min and max
Originally I thought the code was really bad because the OP claimed a linear solution, so I didn't see the array sort at the top. But even with a sorted array, the code still had what I considered major bugs in it.
If I find a bug with the first test input that I try, in my mind the OP didn't spend enough time testing the code. But does that make the code "broken" enough to close the question, or do we simply allow the question and point out all the bugs?