Category: algorithms
You’re given a list of n integers arr. You must compute a list output such that, for each index i (between 0 and n-1, inclusive), output is equal to …
Balanced Split Given an array of integers (which may include repeated integers), determine if there’s a way to split the array into two subarrays A and B such that …
Revenue Milestones X keeps track of the revenue X makes every day, and X wants to know on what days X hits certain revenue milestones. Given an array of …
Given a sequence of n integers arr, determine the lexicographically smallest sequence which may be obtained from it after performing at most k element swaps, each involving a pair …
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. Example: MovingAverage m = new MovingAverage(3); m.next(1) = 1 …