Any true O(1) space solution without modifying the input?


  • 0
    A

    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(n) time O(1) space solution without writing into the input array?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.