2 ms·
Please note, that the solution from the post has O(n) space complexity (you modify the input and this counts as using the extra memory).
by tom1024 12y ago
Please note, that the solution from the post has O(n) space complexity (you modify the input and this counts as using the extra memory).