Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 422 Bytes

File metadata and controls

23 lines (14 loc) · 422 Bytes

58.First Unique Character in a String

Description

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.

Example 1

Input: 'leetcode'
Output: 0

Input: 'loveleetcode'
Output: 2

Note

You may assume the string contain only lowercase letters.

From

LeetCode