剑指 Offer 57 - II. 和为s的连续正数序列 js
2020-12-30 03:29
标签:function var sse tar art off == ++ fun 剑指 Offer 57 - II. 和为s的连续正数序列 js 标签:function var sse tar art off == ++ fun 原文地址:https://www.cnblogs.com/fazero/p/13789626.html// 双指针
var findContinuousSequence = function(target) {
let res = []
let left = 1
let right = 2
while (left start++)
res.push(sub)
left++
} else if (sum > target) {
left++
} else {
right++
}
}
return res
};
下一篇:web前端需要学习什么?
文章标题:剑指 Offer 57 - II. 和为s的连续正数序列 js
文章链接:http://soscw.com/index.php/essay/39193.html