Leetcode Run-Time, Memory Usage Discrepancy

Here are two pictures of the exact same code.

There is the significant difference in Leetcode's analysis of the runtime and memory usage between these submissions even though the code is identical. In the first, my memory usage is in the 95th percentile and in the second i'm in the in the 2nd.

Could someone explain why this is happening?

image
image

Comments (3)