Dsa
Hashing
Easy
Social Handle Case Collision
A legacy social media system allows users to create handles with any casing, but a new policy treats handles as case-insensitive. You need to find how many 'unique' handles (lowercase version) are currently being used by more than one distinct casing variation.
Input Format:
A single line of space-separated strings representing all existing handles.
Output Format:
An integer count of lowercase handle strings that map to at least two different original casing variations.
Example:
Input:
Alice ALICE bob Bob Charlie
Output:
2
(Explanation: 'alice' has variations 'Alice' and 'ALICE'. 'bob' has 'bob' and 'Bob'. 'charlie' only has one variation. Total is 2.)
Key concepts
string normalizationhashingcounting
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now