mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<p>Given an integer array <code>nums</code>, you need to find one <b>continuous subarray</b> that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order.</p>
|
||||
<p>Given an integer array <code>nums</code>, you need to find one <b>continuous subarray</b> such that if you only sort this subarray in non-decreasing order, then the whole array will be sorted in non-decreasing order.</p>
|
||||
|
||||
<p>Return <em>the shortest such subarray and output its length</em>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [2,6,4,8,10,9,15]
|
||||
@@ -11,14 +11,14 @@
|
||||
<strong>Explanation:</strong> You need to sort [6, 4, 8, 10, 9] in ascending order to make the whole array sorted in ascending order.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [1,2,3,4]
|
||||
<strong>Output:</strong> 0
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [1]
|
||||
|
Reference in New Issue
Block a user