This question:

Frequency Queries hackerrank

… got closed for this reason:

Code not implemented or not working as intended …

… as the author wrote:

However, on hackerrank it says the wrong answer even though it expects the same result. Any idea what's going on?

And yes I can see that this is the OP's main concern.


However, the code is working as intended. So the answer to this question is: "It seems to be a problem on the external website".

When this part of the question is edited or removed, it has a solid problem description and a working function for review.

So my question is: Shouldn't this be re-open and edited instead of getting closed?

  • Is this one of those "the site's implementation of the specification is more borked than the code" cases? – Mast Aug 27 at 16:17
  • The short answer is: "The challenge is to make it run on HR. It doesn't, so it doesn't complete the specification." – Mast Aug 27 at 16:18
  • Let's put it this way: what's the point of reviewing the code if the original doesn't work on the site? What's the revised code going to be used for? Being educational is only part of the value of a CR answer. – Mast Aug 27 at 16:19
  • "The challenge is to make it run on HR. It doesn't, so it doesn't complete the specification." - can't argue with that. :D I can see the point in your third comment as well. Maybe you can put all three comments into an answer to address an issue like this in general? Or if there's already some similar discussion on meta, I can also remove my question - haven't been on CR meta this often. @Mast – insertusernamehere Aug 27 at 16:28

No, this question should remain closed as "Not working as intended":

"My code does not work some of the cases on hackerrank for some reason but I can't figure out why. It is not caused by timeout or compiler error. It gives a 'wrong answer' in the compiler but when I try to test my code with the same input on VSCode, it actually works."

The question is asking for help in debugging a problem in the code, which is not a code-review question. If the code could be broken down in to a smaller self-contained example of where the code is going wrong, then it may be a candidate for Stack Overflow, but, at this point, it's not contained enough to be on-topic on Stack Overflow.

  • Not sure it's really a problem in the code, but there's definitely a problem somewhere – Simon Forsberg Sep 1 at 12:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .