There are n people on a social media platform, with the age of each person given in an integer array ages, where ages[i] represents the age of the
A person x will not send a friend request to a person y if any of the following conditions hold true:
ages[y] ages[x]
ages[y] ages[x]
ages[y] ages[x]
Otherwise, x will send a friend request to y.
Return the total number of friend requests sent across all people.
Note: If
xsends a friend request toy,ydoes not necessarily send a friend request tox. Additionally, no person can send a friend request to themselves.
Constraints:
n ages.length
n
ages[i]
There are n people on a social media platform, with the age of each person given in an integer array ages, where ages[i] represents the age of the
A person x will not send a friend request to a person y if any of the following conditions hold true:
ages[y] ages[x]
ages[y] ages[x]
ages[y] ages[x]
Otherwise, x will send a friend request to y.
Return the total number of friend requests sent across all people.
Note: If
xsends a friend request toy,ydoes not necessarily send a friend request tox. Additionally, no person can send a friend request to themselves.
Constraints:
n ages.length
n
ages[i]