Google interview question

Leetcode 1814. Count Nice Pairs in an Array