impl Solution { pubfnnum_friend_requests(ages: Vec<i32>) -> i32 { letmut map = vec![0; 121]; for age in ages { map[age asusize] += 1; } letmut ans = 0; for a in1..121 { let ca = map[a]; for b in1..121 { let cb = map[b]; if b asf64 <= 0.5 * a asf64 + 7asf64 || b > a || b > 100 && a < 100 { continue; } ans += ca * cb; if a == b { ans -= ca; } } } return ans; } }