0805. Split Array With Same Average
https://leetcode.com/problems/split-array-with-same-average
Description
You are given an integer array nums
.
You should move each element of nums
into one of the two arrays A
and B
such that A
and B
are non-empty, and average(A) == average(B)
.
Return true
if it is possible to achieve that and false
otherwise.
Note that for an array arr
, average(arr)
is the sum of all the elements of arr
over the length of arr
.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 30
0 <= nums[i] <= 104
ac
Last updated