I had programming problem: https://leetcode.com/problems/candy/description/
I programmed with Java, came up a O(n) time and O(1) space implementation.
Even the best Java Solution (as per this solution and manually tested by me) is taking 3ms and around 45MB of space.
And same approach(it seems) Rust solution is just 0ms and around 2MB space.
I am interested to know what is happening under the hood that is making Rust program faster than Java?