mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 03:11:42 +08:00
存量题库数据更新
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>arr = [1,4,2,5,3]
|
||||
<pre>
|
||||
<strong>输入:</strong>arr = [1,4,2,5,3]
|
||||
<strong>输出:</strong>58
|
||||
<strong>解释:</strong>所有奇数长度子数组和它们的和为:
|
||||
[1] = 1
|
||||
@@ -24,13 +25,15 @@
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>arr = [1,2]
|
||||
<pre>
|
||||
<strong>输入:</strong>arr = [1,2]
|
||||
<strong>输出:</strong>3
|
||||
<strong>解释:</strong>总共只有 2 个长度为奇数的子数组,[1] 和 [2]。它们的和为 3 。</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>arr = [10,11,12]
|
||||
<pre>
|
||||
<strong>输入:</strong>arr = [10,11,12]
|
||||
<strong>输出:</strong>66
|
||||
</pre>
|
||||
|
||||
@@ -42,3 +45,9 @@
|
||||
<li><code>1 <= arr.length <= 100</code></li>
|
||||
<li><code>1 <= arr[i] <= 1000</code></li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>进阶:</strong></p>
|
||||
|
||||
<p>你可以设计一个 O(n) 时间复杂度的算法解决此问题吗?</p>
|
||||
|
Reference in New Issue
Block a user