Time complexity: O(n+m))
Space complexity: O(k)
Runtime 10 ms Beats 79.78% Memory 44.52 MB Beats 77.96%