Check If Double Exists
Determine whether there exists an element that is at least twice as large as every other element.
Example 1
Input: arr = [2,4]
Output: true
Explanation: 4 == 2*2 — match found, return true.
Output: true
Explanation: 4 == 2*2 — match found, return true.
Example 2
Input: arr = [3,1,7,11]
Output: false
Explanation: There is no pair of elements a,b such that a*2 == b — condition is not satisfied.
Output: false
Explanation: There is no pair of elements a,b such that a*2 == b — condition is not satisfied.
Example 3
Input: arr = [0, 0, 1, 2]
Output: true
Explanation: There is a pair: 0 and 0, since 0*2 == 0 — condition is satisfied.
Output: true
Explanation: There is a pair: 0 and 0, since 0*2 == 0 — condition is satisfied.
Line 1, Char 1