Search
⌘K
Get Premium
Leetcode 1512. Number of Good Pairs
Count how many index pairs (i < j) have equal values in the array. This reduces to aggregating value frequencies and summing the number of pairs each value contributes.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.