题目描述
blablabla
样例
blablabla
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
python 代码
class Solution(object):
def findContinuousSequence(self, sum):
"""
:type sum: int
:rtype: List[List[int]]
"""
res = []
j = 1
s = 1
for i in range(1, sum + 1):
while s < sum:
j += 1
s += j
if s == sum and j - i > 0:
temp = []
for k in range(i, j + 1):
temp.append(k)
res.append(temp)
s -= i
return res