Skip to content

Commit a3122ce

Browse files
committed
Create README - LeetHub
1 parent cb45f7e commit a3122ce

File tree

1 file changed

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

1 file changed

+32
-0
lines changed
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/?envType=daily-question&envId=2024-12-01">1346. Check If N and Its Double Exist</a></h2><h3>Easy</h3><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)