题目描述
blablabla
样例
class Solution(object):
def findContinuousSequence(self, sum):
"""
:type sum: int
:rtype: List[List[int]]
"""
res = []
left, right = 1, 2
while right <= (sum + 1) // 2 and right > left:
tmp = int(float(right + left) / 2 * (right - left + 1))
if tmp == sum:
right += 1
res.append([index for index in range(left, right)])
elif tmp < sum:
right += 1
else:
left += 1
return res