HashMap & Set

Count Duplicate Elements

easy
Given an array `arr`, return how many **distinct** values appear more than once. Example: `countDuplicates([1,2,2,3,3,3,4])` → `2` (values 2 and 3).
Hint steps(0/2 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.