Number of Good Pairs
Given an array of integers nums
.
A pair (i,j)
is called good if nums[i]
== nums[j]
and i
< j
.
Return the number of good pairs.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 100
1 <= nums[i] <= 100
Solutions
🧠 Cpp
Last updated
Was this helpful?