Loading...

The First Stranger

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
junior, mid

Problem

A spam filter needs to identify the first character in a message that appears exactly once, from left to right, to generate a unique fingerprint. Write a function that takes a string and returns the first non-repeated character. Return an empty string if all characters repeat.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.