You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given N and K, produces and ordered random subset of [|1, N|] containing K elements. The elements are returned one by one. Time complexity is O(K*log(N)). Space complexity is O(1).