v1 time O(log(m)+log(n)) space O(1) Accepted