v3 time O(1) space O(1) Accepted