Find Three Consecutive Integers That Sum to a Given Number LeetCode solution in Python

1
class Solution:
2
def sumOfThree(self, num: int) -> List[int]:
3
temp = (num - 3) / 3
4
if floor(temp) == ceil(temp):
5
return [int(temp), int(temp) + 1, int(temp) + 2]
6
else:
7
return []

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0