1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/和为s的连续正数序列 [he-wei-sde-lian-xu-zheng-shu-xu-lie-lcof].html

28 lines
657 B
HTML
Raw Normal View History

2022-03-27 20:38:29 +08:00
<p>输入一个正整数 <code>target</code> ,输出所有和为 <code>target</code> 的连续正整数序列(至少含有两个数)。</p>
<p>序列内的数字由小到大排列,不同序列按照首个数字从小到大排列。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>target = 9
<strong>输出:</strong>[[2,3,4],[4,5]]
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>target = 15
<strong>输出:</strong>[[1,2,3,4,5],[4,5,6],[7,8]]
</pre>
<p>&nbsp;</p>
<p><strong>限制:</strong></p>
<ul>
<li><code>1 &lt;= target &lt;= 10^5</code></li>
</ul>
<p>&nbsp;</p>