Tap here to switch tabs
Problem
Submissions

Problem: Number of Good Pairs

med
30 min
Try to solve the Number of Good Pairs problem.

Statement

Given an array of integers nums, return the total count of good pairs.

A pair (i, j) is considered good if nums[i] == nums[j] and i << j.

Constraints:

  • 11 \leq nums.length 102\leq 10^2

  • 11 \leq nums[i] 102\leq 10^2

Tap here to switch tabs
Problem
Submissions

Problem: Number of Good Pairs

med
30 min
Try to solve the Number of Good Pairs problem.

Statement

Given an array of integers nums, return the total count of good pairs.

A pair (i, j) is considered good if nums[i] == nums[j] and i << j.

Constraints:

  • 11 \leq nums.length 102\leq 10^2

  • 11 \leq nums[i] 102\leq 10^2