Skip to content

Commit 7f82dc5

Browse files
committed
Create README - LeetHub
1 parent af41262 commit 7f82dc5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

0704-binary-search/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
<h2><a href="https://leetcode.com/problems/binary-search/">704. Binary Search</a></h2><h3>Easy</h3><hr><div><p>Given an array of integers <code>nums</code> which is sorted in ascending order, and an integer <code>target</code>, write a function to search <code>target</code> in <code>nums</code>. If <code>target</code> exists, then return its index. Otherwise, return <code>-1</code>.</p>
1+
<h2><a href="https://leetcode.com/problems/binary-search">792. Binary Search</a></h2><h3>Easy</h3><hr><p>Given an array of integers <code>nums</code> which is sorted in ascending order, and an integer <code>target</code>, write a function to search <code>target</code> in <code>nums</code>. If <code>target</code> exists, then return its index. Otherwise, return <code>-1</code>.</p>
22

33
<p>You must write an algorithm with <code>O(log n)</code> runtime complexity.</p>
44

55
<p>&nbsp;</p>
66
<p><strong class="example">Example 1:</strong></p>
77

8-
<pre><strong>Input:</strong> nums = [-1,0,3,5,9,12], target = 9
8+
<pre>
9+
<strong>Input:</strong> nums = [-1,0,3,5,9,12], target = 9
910
<strong>Output:</strong> 4
1011
<strong>Explanation:</strong> 9 exists in nums and its index is 4
1112
</pre>
1213

1314
<p><strong class="example">Example 2:</strong></p>
1415

15-
<pre><strong>Input:</strong> nums = [-1,0,3,5,9,12], target = 2
16+
<pre>
17+
<strong>Input:</strong> nums = [-1,0,3,5,9,12], target = 2
1618
<strong>Output:</strong> -1
1719
<strong>Explanation:</strong> 2 does not exist in nums so return -1
1820
</pre>
@@ -26,4 +28,3 @@
2628
<li>All the integers in <code>nums</code> are <strong>unique</strong>.</li>
2729
<li><code>nums</code> is sorted in ascending order.</li>
2830
</ul>
29-
</div>

0 commit comments

Comments
 (0)