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

doesn't fully satisfy the requirement since the stack will use O(log(n)) space