vok8's blog

By vok8, history, 4 years ago, In English

  • Submission-1: (AC - 856 ms)


  • Submission-2: (AC - 1824 ms)


The Code

  • The code in the above 2 submissions is wholly same/identical (Not even a single bit in the codes is differing).

  • I ain't getting what could be the reason of such a huge time difference between the running time of fully identical codes. I mean, 30-100 ms difference is fine, as that can be there, due to server load and/or some other server related stuff. But, the difference is ~1 second, which seems very weird and strange.

  • For checking the correctness of what I have experienced, you can try submitting the above code 2-3 times continuously, after some 2-3 min stretch, between each submission. I think, you will get my doubt perfectly, then!

  • Can someone please explain, what can be the reason behind this huge "running time" difference?

  • Thank you!

  • Vote: I like it
  • +21
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Please share ideone link to the submissions, the above link doesn't work.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hey, sorry for that!

    I didn't know, LeetCode doesn't allow the submission link to be opened/accessed by any other LeetCode user.

    I have added my code and the screenshots of the "running time" for both the submissions, above.