Round 1
Questions: Given a list of array with positive numbers and capacity c. Give the minimum number of boxes that needed to be unloaded so that below condition is satisfied: max(array) <= capacity * min(array)
For example, array = [1,4,3,2] and capacity = 2. The minimum number of boxes to be unloaded = 1. The numbers in the array could contain duplicates.
Follow-up Question
Is there a better approach than recursive and memoization solutions?
Candidate's Approach
The candidate considered a recursive and memoization solution due to the dependency on both min and max values of the array. They proposed creating two subproblems:
- Removing the minimum item.
- Removing the maximum item.
The recursion would continue until the condition is satisfied.
Interviewer's Feedback
No feedback provided.