You are viewing a single comment's thread. Return to all 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))
O(N)+O(K)
O(N)
O(1)
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
I think this algorithm has
O(N)+O(K)
time complexity (notO(N)
as the author estimated) andO(N)
space complexity (notO(1)
)