---
# System prepended metadata

title: '[1512. Number of Good Pairs](https://leetcode.com/problems/number-of-good-pairs/)'

---

# [1512. Number of Good Pairs](https://leetcode.com/problems/number-of-good-pairs/)
![](https://i.imgur.com/RcnbNoU.png)
![](https://i.imgur.com/2syPfQ2.png)


int numIdenticalPairs(int* nums, int numsSize)
{
    int n=0;
    for(int i=0;i<numsSize;i++)
    {
        for(int j=i+1;j<numsSize;j++)
        {
            if(nums[i] == nums[j])
            {
                n++;
            }
        }
    }
    return n;
}