#488 Finding the First Non-Repeating Character

Companies:
Ozon
Themes:
AlgorithmsStringsPractice

A string s is given. Find the first non-repeating character in the string and return its index. If no such character exists, return -1.

Example:

Text
input: abcbaad
output: 2

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in