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
iandjmust be different.
Constraints:
arr.length
arr[i]
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
iandjmust be different.
Constraints:
arr.length
arr[i]