My stupid solution has to modify the input array, so it is not really
O(1) space, because what if the input array is Read-Only.
Is there any true
O(1) space solution without writing into the input array?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.