1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-18 19:46:47 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 12:43:11 +08:00
parent 58bbdfd57c
commit 2b0511d272
10721 changed files with 8123 additions and 8119 deletions

View File

@@ -0,0 +1,9 @@
<p>给定一个整数数组,编写一个函数,找出索引<code>m</code><code>n</code>,只要将索引区间<code>[m,n]</code>的元素排好序,整个数组就是有序的。注意:<code>n-m</code>尽量最小,也就是说,找出符合条件的最短序列。函数返回值为<code>[m,n]</code>,若不存在这样的<code>m</code><code>n</code>(例如整个数组是有序的),请返回<code>[-1,-1]</code></p>
<p><strong>示例:</strong></p>
<pre><strong>输入:</strong> [1,2,4,7,10,11,7,12,6,7,16,18,19]
<strong>输出:</strong> [3,9]
</pre>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 <= len(array) <= 1000000</code></li>
</ul>