• + 0 comments

    time = O(n + m), space = O(n)

    or in your algorithm...it's O(N + K) and O(N)