Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd872e02

Browse files
refactor 1346
1 parent2c84a2f commitd872e02

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

‎src/main/java/com/fishercoder/solutions/_1346.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
11
packagecom.fishercoder.solutions;
22

3-
/**
4-
* 1346. Check If N and Its Double Exist
5-
*
6-
* Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M).
7-
*
8-
* More formally check if there exists two indices i and j such that :
9-
*
10-
* i != j
11-
* 0 <= i, j < arr.length
12-
* arr[i] == 2 * arr[j]
13-
*
14-
* Example 1:
15-
* Input: arr = [10,2,5,3]
16-
* Output: true
17-
* Explanation: N = 10 is the double of M = 5,that is, 10 = 2 * 5.
18-
*
19-
* Example 2:
20-
* Input: arr = [7,1,14,11]
21-
* Output: true
22-
* Explanation: N = 14 is the double of M = 7,that is, 14 = 2 * 7.
23-
*
24-
* Example 3:
25-
* Input: arr = [3,1,7,11]
26-
* Output: false
27-
* Explanation: In this case does not exist N and M, such that N = 2 * M.
28-
*
29-
* Constraints:
30-
* 2 <= arr.length <= 500
31-
* -10^3 <= arr[i] <= 10^3
32-
* */
333
publicclass_1346 {
344
publicstaticclassSolution1 {
355
publicbooleancheckIfExist(int[]arr) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp