Time complexity: O(n+m)
Space complexity: O(1)
Runtime 0 ms Beats 100.00% Memory 42.17 MB Beats 27.80%