Given an integer array nums, return the number of good pairs. A pair (i, j) is good if nums[i] == nums[j] and i < j.
Input: An integer array nums of length n.
Output: Integer — count of good pairs.
Input: [1,2,3,1,1,3]
Output: 4
Explanation: (0,3),(0,4),(3,4) for value 1 = C(3,2)=3 pairs. (2,5) for value 3 = 1 pair. Total = 4.Input: [1,1,1,1]
Output: 6
Explanation: All 4 elements equal 1. C(4,2) = 6 pairs.Input: [1,2,3]
Output: 0
Explanation: All elements distinct. No good pairs.1 <= nums.length <= 1001 <= nums[i] <= 100