Tap here to switch tabs
Problem
Submissions

Problem: Check If N and Its Double Exist

med
30 min
Try to solve the Check If N and Its Double Exist problem.

Statement

Given an integer array arr, determine whether there exist two distinct indices i and j such that arr[i] is exactly double arr[j]. Return true if such a pair exists, otherwise return false.

Note: The indices i and j must be different.

Constraints:

  • 2≤2 \leq arr.length ≤500\leq 500

  • −103≤-10^3 \leq arr[i] ≤103\leq 10^3

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check If N and Its Double Exist

med
30 min
Try to solve the Check If N and Its Double Exist problem.

Statement

Given an integer array arr, determine whether there exist two distinct indices i and j such that arr[i] is exactly double arr[j]. Return true if such a pair exists, otherwise return false.

Note: The indices i and j must be different.

Constraints:

  • 2≤2 \leq arr.length ≤500\leq 500

  • −103≤-10^3 \leq arr[i] ≤103\leq 10^3