โ† CarWale questions

Perfect Pairs

Filed under CarWale

The question

Given an array of integers, find the number of pairs (i, j) with 0 <= i < j < n such that min(|x-y|, |x+y|) <= min(|x|, |y|) and max(|x-y|, |x+y|) >= max(|x|, |y|).

No write-up yet. Related questions below have one.

Related CarWale questions

Collected from public candidate posts and coding forums. Updated Nov 2026.