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