Find Three Consecutive Integers That Sum to a Given Number
Given an integer num, return three consecutive integers as a sorted array that sum to num.
If num cannot be expressed as the sum of three consecutive integers, return an empty array.
Example 1
Input
num = 33Output
[10,11,12]33 can be expressed as 10 + 11 + 12, and these are three consecutive integers.
Example 2
Input
num = 4Output
[]There is no way to express 4 as the sum of 3 consecutive integers.
Constraints
- 0 <= num <= 10^15