Given an array of integers nums, return the number of good pairs. A pair (i, j) is called good if: • nums[i] == nums[j], and • i < j.
Input: nums = [1, 2, 3, 1, 1, 3]
Output: 4
Input: nums = [1, 1, 1, 1]
Output: 6
Accepted:
Submission: