BackmediumUncategorized uncategorized medium

Count Unique Identifiers Solution

Problem Statement

You are given a list of identifiers, determine the total number of unique identifiers and the number of duplicates.

Example 1
Input
{"identifiers":[1223444]}
Output
{"uniqueCount":4,"duplicateCount":3}

Explanation: Corrected duplicate count from 4 to 3, since there are 4 unique identifiers and the duplicates are 2 (for identifier 2) and 3 (for identifier 4)

Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free