Company: Apple
Difficulty: medium
Perfect Pairs Problem Description A pair of integers (x, y) is perfect if both of the following conditions are met: - min(|x - y|, |x + y|) ≤ min(|x|, |y|) - max(|x - y|, |x + y|) ≥ max(|x|, |y|) Given an array arr of length n, find the number of perfect pairs (arr[i], arr[j]) where 0 ≤ i 2, the first condition (3 ≤ 2) is false. - Therefore, (2, 5) is not a perfect pair.