Back to exercises

First Non-Repeating Character

Build a frequency map for the characters, then iterate through the string a second time to return the first character whose count is one.

Coding Exercises Easy O(n)

First Non-Repeating Character

Build a frequency map for the characters, then iterate through the string a second time to return the first character whose count is one.

Return the first character in a string that appears exactly once, or an empty string if none exists.