O(1) space complexity but beats only 46.75% of Java submission
Anonymous User
40

My submission: https://leetcode.com/submissions/detail/670346591/ used only O(1) space - basically, just a few local variables. I wonder how this can only beats 46.75% of Java submissions (but not 100%). Also, the 43.1MB seems to be related to the size of the compiled code, rather than the memory i allocated within my program. Not sure if Leetcode may add more import libraries time to time, wondering if this can impact the binary size and hence the percentile of memory usage.

Also, the running time is integral millisecond. This sounds like to be too rough for some small problem. Could we change it into double type, or use microseconds as the unit?

Comments (0)