v1 time O(1) space O(n) Accepted