Dsa
Hashing
Warm-up
Count Unique Items
You are given a list of items purchased in a store. Each item corresponds to a string. Write a program that reads the list of items and prints the count of unique items purchased. The input will consist of multiple lines where each line contains one item. The end of input is indicated by an empty line. Example input:
apple
banana
apple
orange
Output should write the total unique count in a single line.
Example output:
3
Key concepts
hashingcountingdictionaries
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