2177. Find Three Consecutive Integers That Sum to a Given Number

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2177

class Solution:
    def sumOfThree(self, num: int) -> List[int]:
        x, mod = divmod(num, 3)
        return [] if mod else [x - 1, x, x + 1]