• + 0 comments

    I think this algorithm has O(N)+O(K) time complexity (not O(N) as the author estimated) and O(N) space complexity (not O(1))