1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 23:41:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,13 +1,13 @@
<p>You are given an integer array <code>nums</code>. You have an integer array <code>arr</code> of the same length with all values set to <code>0</code> initially. You also have the following <code>modify</code> function:</p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/07/10/sample_2_1887.png" style="width: 573px; height: 294px;" />
<p>You want to use the modify function to covert <code>arr</code> to <code>nums</code> using the minimum number of calls.</p>
<p>You want to use the modify function to convert <code>arr</code> to <code>nums</code> using the minimum number of calls.</p>
<p>Return <em>the minimum number of function calls to make </em><code>nums</code><em> from </em><code>arr</code>.</p>
<p>The test cases are generated so that the answer fits in a <strong>32-bit</strong> signed integer.</p>
<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> nums = [1,5]
@@ -18,7 +18,7 @@ Increment by 1 (both elements) [0, 4] -&gt; [1, 4] -&gt; <strong>[1, 5]</strong
Total of operations: 1 + 2 + 2 = 5.
</pre>
<p><strong>Example 2:</strong></p>
<p><strong class="example">Example 2:</strong></p>
<pre>
<strong>Input:</strong> nums = [2,2]
@@ -28,7 +28,7 @@ Double all the elements: [1, 1] -&gt; <strong>[2, 2]</strong> (1 operation).
Total of operations: 2 + 1 = 3.
</pre>
<p><strong>Example 3:</strong></p>
<p><strong class="example">Example 3:</strong></p>
<pre>
<strong>Input:</strong> nums = [4,2,5]