Google Interview Question

Leetcode 1814. Count Nice Pairs in an Array