Q1: Given a stream of numbers coming, find the sum of the last k numbers. (k is given beforehand)
Follow-up: sum of last k - (sum to top n%tile), i.e. subtract the top n%tile from the sum.
Comments (11)
Q1: Given a stream of numbers coming, find the sum of the last k numbers. (k is given beforehand)
Follow-up: sum of last k - (sum to top n%tile), i.e. subtract the top n%tile from the sum.