Dsa
Hashing
Warm-up
Simple URL Shortener Counts
You are tasked to analyze how many times each short URL is accessed. You will receive multiple lines of short URLs. The input ends when an empty line is received. Your program should print each unique URL and the count of how many times each was accessed, one per line. Example input:
short.ly/abc
short.ly/def
short.ly/abc
Output should format:
short.ly/abc 2
short.ly/def 1
Key concepts
hashingdictionariescounting
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