Ad
  • Custom User Avatar
  • Custom User Avatar

    Hi,

    I didn't get any notification of your first message, sorry...

    The specs, seem sparse, but I think they are actually pretty correct here: the only place where renumbering is talked about is in the unlock method. So if ever you rearrange something in some other places, you're not following the specs.

    Does that clarify the matter?


    edit: could you still extract a concrete (but rather simple) case where your solution was failing because of that?

  • Custom User Avatar

    No, you didn't have to? What you call answers is actually the answer key, and what you call key are the student's answers, and you treat them as such. You switched the names, but you did not switch the meanings.

  • Custom User Avatar

    Duplicate issue, check redsketch's post below. Closing this one.

  • Custom User Avatar

    In your code you effectively change the input array trips. You can find that out if you do a console.log(trips) just before you return your result. If you don't change the input array, your answer will be accepted.

    Cheers.

  • Custom User Avatar

    I can reproduce your error, with the code I get from your post (view solution option). However submitting another solution with a wrong answer (right answer + 1) cleanly receives the error:

    Random tests
    Random test #1
    Log
    [ [ 63, 82 ],
      [ 261, 277 ],
      [ 251, 278 ],
      [ 193, 205 ],
      [ 17, 50 ],
      [ 226, 262 ] ]
    Expected: 120, instead got: 121
    Completed in 3ms
    
    

    I am not an expert in JS and I have no clue what goes wrong.

  • Custom User Avatar

    Changed to "No, I am your father". It's been a while since I watched the old trilogy for the last time. Thanks for positive feedback :)

  • Custom User Avatar

    That means javascript sort is not stable in the environment.