Practice Split Array With Same Average
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Split Array With Same Average
Problem Statement
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.
Source: Split Array With Same Average on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [1,2,3,4,5,6,7,8]
true
# Example 2
nums = [3,1]
false
Constraints
Related LeetCode Problems
Practice more problems similar to Split Array With Same Average.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.