If the input is array, I'm always wondering whether we should treat it as read-only by default?
I can see some solutions modified the input array and claims that they use no extra space.
Thanks