Round 1
Questions:
Given the arrays size
and cost
for the product, find the minimal total cost in order to make all the sizes distinct. The size of the i-th product, size[i]
, can be increased by one unit for an amount in the cost
array, cost[i]
.
Specific question not provided.
Follow-up Question
- Why is the provided solution producing an output of 17 instead of the expected output of 6?
Candidate's Approach
The candidate attempted to solve the problem by pairing sizes with their respective costs, sorting them, and then using a set to track used sizes. The approach involved incrementing sizes until they became unique while accumulating the total cost. However, the candidate noted that despite this approach, the output was incorrect.
Interviewer's Feedback
No feedback provided.