Loading...

The Lone Character

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

Domain
Python
Difficulty
easy
Seniority
senior

Problem

Our search indexer assigns a unique shard key based on the first non-repeated character in a string. Write a function called first_unique_char that takes a string and returns the first character appearing exactly once. Return an empty string if every character repeats.

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.