Available question text
Count the number of ordered pairs (x → y), x ≠ y, such that age[y] > 0.5*age[x] + 7, age[y] ≤ age[x], and not (age[y] > 100 and age[x] < 100). The core challenge is efficiently counting pairs that satisfy these age-based inequalities (ages are bounded 1..120) without checking all O(n^2) pairs.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Meta
Leetcode 825. Friends Of Appropriate Ages
Reported Sep 1, 2026 · 2 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View source