Lecture
Coding Quiz - Find the First Non-repeating Character
In this coding quiz, you will write a function to find the first non-repeating character in an array of strings using a hash table.
For instance, given the character array ['a', 'b', 'c', 'a', 'c'], the function should return b.
If all characters are repeated, return None.
Write your code
def solution(char_array): # Write your code here return
Constraints
-
The character array consists only of lowercase English letters.
-
The array size is at least 1.
Example Input and Output
- Input:
['a', 'b', 'c', 'a', 'c'] - Output:
'b'
- Input:
['x', 'y', 'y', 'z', 'z', 'x'] - Output:
None
Lessons in this chapter · Review and Deepen Understanding of Python Data Structures
- 1. Review of Key Data Structures
- 2. Multiple-choice quiz
- 3. Fill-in-the-blank quiz
- 4. Coding Quiz - Reverse Words
- 5. Coding Quiz - Task Scheduling
- 6. Coding Quiz - Check for Value Existence
- 7. Coding Quiz - Find the First Non-repeating Character
- 8. What is a Tree?
- 9. Tree Implementation Techniques
- 10. Multiple-choice quiz
- 11. Coding Quiz - Find Minimum Odd Value
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help