← All problemsSign in

825. Friends Of Appropriate Ages

LeetCodeArrayTwo PointersBinary SearchSortingOpen on judge ↗

There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person. A Person x will not send a friend request to a person y (x != y) if any of the following conditions is true: - age[y] <= 0.5 * age[x] + 7 - age[y] > age[x] - age[y] > 100 && age[x] < 100 Otherwise, x will send a friend request to y. Note that if x sends a request to

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start