Skip to content

Commit 6b62b23

Browse files
committed
Create README - LeetHub
1 parent 9a7ce28 commit 6b62b23

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h2><a href="https://leetcode.com/problems/find-the-highest-altitude">1732. Find the Highest Altitude</a></h2><h3>Easy</h3><hr><p>There is a biker going on a road trip. The road trip consists of <code>n + 1</code> points at different altitudes. The biker starts his trip on point <code>0</code> with altitude equal <code>0</code>.</p>
2+
3+
<p>You are given an integer array <code>gain</code> of length <code>n</code> where <code>gain[i]</code> is the <strong>net gain in altitude</strong> between points <code>i</code>​​​​​​ and <code>i + 1</code> for all (<code>0 &lt;= i &lt; n)</code>. Return <em>the <strong>highest altitude</strong> of a point.</em></p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> gain = [-5,1,5,0,-7]
10+
<strong>Output:</strong> 1
11+
<strong>Explanation:</strong> The altitudes are [0,-5,-4,1,1,-6]. The highest is 1.
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> gain = [-4,-3,-2,-1,4,3,2]
18+
<strong>Output:</strong> 0
19+
<strong>Explanation:</strong> The altitudes are [0,-4,-7,-9,-10,-6,-3,-1]. The highest is 0.
20+
</pre>
21+
22+
<p>&nbsp;</p>
23+
<p><strong>Constraints:</strong></p>
24+
25+
<ul>
26+
<li><code>n == gain.length</code></li>
27+
<li><code>1 &lt;= n &lt;= 100</code></li>
28+
<li><code>-100 &lt;= gain[i] &lt;= 100</code></li>
29+
</ul>

0 commit comments

Comments
 (0)