Panda Guru LogoPanda
Guru

Amazon OA SDE 2

Round 1

Questions: Determine the minimum number of items to remove from an array of prices so that the sum of k items does not exceed a given threshold.

Constraints:

Candidate's Approach

First, sort the array. Then, find the k prefix sum at each index from the left. Iterate through the prefix sum until a value greater than the threshold is found. Return n - i if found, else return 0.

Interviewer's Feedback

No feedback provided.