Easy

Quiz

#387 First Unique Character in a String

APPROACH

Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.

1 of 4

What is the optimal approach for this problem?