Find first non-repeating character
Company: Walmart Labs
Role: Machine Learning Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Onsite
Given a string `s`, return the **first character that appears exactly once** in the string (i.e., the leftmost non-repeating character).
- If no such character exists, return an empty string (or a sentinel like `""`).
### Examples
- Input: `"leetcode"` → Output: `"l"`
- Input: `"aabb"` → Output: `""`
### Constraints
- `1 ≤ len(s) ≤ 1e5`
- `s` contains standard ASCII letters/digits/punctuation (you may assume ASCII for counting).
Quick Answer: This question evaluates string manipulation, frequency-counting concepts, algorithmic complexity reasoning, and attention to edge-case handling in sequence data.
Return the leftmost character that appears exactly once, or an empty string.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ('leetcode',)
Expected Output: 'l'
Explanation: l is first non-repeating.
Input: ('aabb',)
Expected Output: ''
Explanation: No non-repeating character.
Input: ('swiss',)
Expected Output: 'w'
Explanation: w is first unique.
Hints
- Clarify edge cases before coding.
- Keep the return value deterministic.