Skip to content

Commit 7e384d5

Browse files
committed
Added README.md file for Check If N and Its Double Exist
1 parent 2f6f11f commit 7e384d5

File tree

1 file changed

+32
-0
lines changed
  • 1468-check-if-n-and-its-double-exist

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h2><a href="https://leetcode.com/problems/check-if-n-and-its-double-exist">Check If N and Its Double Exist</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given an array <code>arr</code> of integers, check if there exist two indices <code>i</code> and <code>j</code> such that :</p>
2+
3+
<ul>
4+
<li><code>i != j</code></li>
5+
<li><code>0 &lt;= i, j &lt; arr.length</code></li>
6+
<li><code>arr[i] == 2 * arr[j]</code></li>
7+
</ul>
8+
9+
<p>&nbsp;</p>
10+
<p><strong class="example">Example 1:</strong></p>
11+
12+
<pre>
13+
<strong>Input:</strong> arr = [10,2,5,3]
14+
<strong>Output:</strong> true
15+
<strong>Explanation:</strong> For i = 0 and j = 2, arr[i] == 10 == 2 * 5 == 2 * arr[j]
16+
</pre>
17+
18+
<p><strong class="example">Example 2:</strong></p>
19+
20+
<pre>
21+
<strong>Input:</strong> arr = [3,1,7,11]
22+
<strong>Output:</strong> false
23+
<strong>Explanation:</strong> There is no i and j that satisfy the conditions.
24+
</pre>
25+
26+
<p>&nbsp;</p>
27+
<p><strong>Constraints:</strong></p>
28+
29+
<ul>
30+
<li><code>2 &lt;= arr.length &lt;= 500</code></li>
31+
<li><code>-10<sup>3</sup> &lt;= arr[i] &lt;= 10<sup>3</sup></code></li>
32+
</ul>

0 commit comments

Comments
 (0)