Ad
  • Default User Avatar

    Yeah, you only ever need the last two cache entries.

  • Custom User Avatar

    That only works if the order of the keys maintains constant. This is not only not guaranteed within JavaScript, but has already been proven to cause issues earlier.

    It might be a fluke that the solution you see passed when it was written. It's possible that an updated Node engine is more strict. I specifically expect an empty object with no keys if the input string is empty.

  • Custom User Avatar

    Your code fails when dealing with an empty query string. Please read the output when submitting the code.

    I don't know why it's failing on the example tests for me, but that used to work, and I haven't changed anything. I think it's a Codewars bug.

  • Custom User Avatar

    Thanks. Changed it :)