Dsa
Hashing
Medium
Find First Repeating Character
Given a string, find the first character that repeats. If no character repeats, return 'no repetition'. The function should be case-sensitive.
Input Format:
A single line containing the string. The length of the string will be at most 1000 characters.
Output Format:
Print the first repeating character or 'no repetition' if none exist.
Example:
Input:
aBcDceFg
Output:
D
Key concepts
hashingcharacterssearching
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