You are given an integer array
You should move each element of
nums into one of the two arrays
B such that
B are non-empty, and
average(A) == average(B).
true if it is possible to achieve that and
Note that for an array
average(arr) is the sum of all the elements of
arr over the length of
Input: nums = [1,2,3,4,5,6,7,8] Output: true Explanation: We can split the array into [1,4,5,8] and [2,3,6,7], and both of them have an average of 4.5.
Input: nums = [3,1] Output: false
1 <= nums.length <= 30
0 <= nums[i] <= 104