EASYREWARDZ On-Campus OA (2024) | Minimum Average Difference
Question · Posted Jun 2026
Problem: Minimum Average Difference Given a 0-indexed integer array nums, find the index i where the absolute difference between: Average of the first i + 1 elements Average of the remaining elements is minimum. Return the smallest index with the minimum average difference. Example Input nums = [2,5,3,9,5,3] Output 3 Explanation Index Left Average Right Average Difference 0 2 5 3 1 3 5 2 2 3 5 2 3 4 4 0 4 4 3 1 5 4 0 ...
The full answer & interview discussion are available to premium members.
Log in Create a free account