mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 08:21:41 +08:00
移除零宽空格
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<p>You are given an <strong>even</strong> integer <code>n</code>. You initially have a permutation <code>perm</code> of size <code>n</code> where <code>perm[i] == i</code> <strong>(0-indexed)</strong>.</p>
|
||||
<p>You are given an <strong>even</strong> integer <code>n</code>. You initially have a permutation <code>perm</code> of size <code>n</code> where <code>perm[i] == i</code> <strong>(0-indexed)</strong>.</p>
|
||||
|
||||
<p>In one operation, you will create a new array <code>arr</code>, and for each <code>i</code>:</p>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<li>If <code>i % 2 == 1</code>, then <code>arr[i] = perm[n / 2 + (i - 1) / 2]</code>.</li>
|
||||
</ul>
|
||||
|
||||
<p>You will then assign <code>arr</code> to <code>perm</code>.</p>
|
||||
<p>You will then assign <code>arr</code> to <code>perm</code>.</p>
|
||||
|
||||
<p>Return <em>the minimum <strong>non-zero</strong> number of operations you need to perform on </em><code>perm</code><em> to return the permutation to its initial value.</em></p>
|
||||
|
||||
@@ -45,5 +45,5 @@ So it takes only 2 operations.
|
||||
|
||||
<ul>
|
||||
<li><code>2 <= n <= 1000</code></li>
|
||||
<li><code>n</code> is even.</li>
|
||||
<li><code>n</code> is even.</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user