Practice Find Three Consecutive Integers That Sum to a Given Number
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
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.
Source: Find Three Consecutive Integers That Sum to a Given Number on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
num = 33
Output
[10,11,12]
# Example 2
Input
num = 4
Output
[]
Constraints
0 <= num <= 10^15
Related LeetCode Problems
Practice more problems similar to Find Three Consecutive Integers That Sum to a Given Number.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.