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