Practice Check If N and Its Double Exist
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Easy#1346
LeetCode ProblemCheck If N and Its Double Exist
Problem Statement
Return whether arr contains two different valid indices i and j with arr[i] = 2 * arr[j]. Index identity matters: a single zero cannot pair with itself, but two separate zero occurrences can qualify.
Source: Check If N and Its Double Exist on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
arr = [10,2,5,3]
Output
true
# Example 2
Input
arr = [3,1,7,11]
Output
false
Constraints
2 <= arr.length <= 500
-10^3 <= arr[i] <= 10^3
Related LeetCode Problems
Practice more problems similar to Check If N and Its Double Exist.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.