1346. Check If N and Its Double Exist
https://leetcode.com/problems/check-if-n-and-its-double-exist
Description
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
).
More formally check if there exists two indices i
and j
such that :
i != j
0 <= i, j < arr.length
arr[i] == 2 * arr[j]
Example 1:
Example 2:
Example 3:
Constraints:
2 <= arr.length <= 500
-10^3 <= arr[i] <= 10^3
ac
Last updated