Check If N and Its Double Exist

Given an integer array arr, return true if there are two distinct indices i and j such that arr[i] = 2 × arr[j]. Otherwise return false.

Given an integer array `arr`, return `true` if there are two distinct indices `i` and `j` such that `arr[i] = 2 × arr[j]`. Otherwise return `false`.

- `1 <= arr.length <= 10^5` - `-10^9 <= arr[i] <= 10^9` - The interactive visualizer accepts at most 12 values; longer valid arrays are execution-only.

Example 1: input arr = [10, 2, 5, 3]; output true. 10 is twice 5.

Example 2: input arr = [0]; output false. One zero cannot use its own index twice.

Category: Arrays & Hashing. Topic: arrays. Difficulty: Easy. Patterns: hashing.