You are given a nums of length n.
The average difference at index i is the absolute difference between the average of the first nums and the average of the last nums. Both averages must be rounded down to the nearest integer.
Return the index with the minimum average difference. If there are multiple indices with the same minimum average difference, return the smallest index.
Note:
The average of
elements is the sum of the elements divided by , rounded down to the nearest integer using integer division. The average of
elements is considered to be .
Constraints:
nums.length
nums[i]
You are given a nums of length n.
The average difference at index i is the absolute difference between the average of the first nums and the average of the last nums. Both averages must be rounded down to the nearest integer.
Return the index with the minimum average difference. If there are multiple indices with the same minimum average difference, return the smallest index.
Note:
The average of
elements is the sum of the elements divided by , rounded down to the nearest integer using integer division. The average of
elements is considered to be .
Constraints:
nums.length
nums[i]