mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-13 17:35:14 +08:00
update
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<p>You are given a <strong>0-indexed</strong> array of integers <code>nums</code> of length <code>n</code>. You are initially positioned at <code>nums[0]</code>.</p>
|
||||
<p>You are given a <strong>0-indexed</strong> array of integers <code>nums</code> of length <code>n</code>. You are initially positioned at index 0.</p>
|
||||
|
||||
<p>Each element <code>nums[i]</code> represents the maximum length of a forward jump from index <code>i</code>. In other words, if you are at <code>nums[i]</code>, you can jump to any <code>nums[i + j]</code> where:</p>
|
||||
<p>Each element <code>nums[i]</code> represents the maximum length of a forward jump from index <code>i</code>. In other words, if you are at index <code>i</code>, you can jump to any index <code>(i + j)</code> where:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= j <= nums[i]</code> and</li>
|
||||
<li><code>i + j < n</code></li>
|
||||
</ul>
|
||||
|
||||
<p>Return <em>the minimum number of jumps to reach </em><code>nums[n - 1]</code>. The test cases are generated such that you can reach <code>nums[n - 1]</code>.</p>
|
||||
<p>Return <em>the minimum number of jumps to reach index </em><code>n - 1</code>. The test cases are generated such that you can reach index <code>n - 1</code>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
Reference in New Issue
Block a user