Dsa
Hashing
Warm-up
First Non-Repeating Character
Write a program that finds the first non-repeating character in a given string. If all characters repeat, return '-1'. The input will be a single line string. The output should be a single character or '-1'.
Example:
Input:
aabbccde
d
Output:
d
Key concepts
hashingstringsfrequency
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