Maximum Split of Positive Even Integers
You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers.
Return a list of integers that represent a valid split containing a maximum number of integers. If no valid split exists for finalSum, return an empty list. You may return the integers in any order.
Example 1
Input
finalSum = 12Output
[2,4,6]The split
(2 + 4 + 6) has the maximum number of integers, which is 3, so [2,4,6] is returned.Example 2
Input
finalSum = 7Output
[]There are no valid splits for the given
finalSum, so an empty array is returned.Constraints
- 1 <= finalSum <= 10^10