Goldman Sachs Question 2020 Interview | Running stream Most Recent
Anonymous User
704
Given a running stream of integers finds the most recently used k integers in the array. An example would clear up the stuff. 
Eg: 
Array = [1, 3, 2, 4, 2, 1, 4, 1, 5] and k = 4 
Output: [5, 1, 4, 2].
Comments (2)