387.First-Unique-Character-in-a-String
387. First Unique Character in a String
题目地址
https://leetcode.com/problems/first-unique-character-in-a-string/
题目描述
代码
Approach #1 Linear time solution
Complexity Analysis
Time complexity : O(N) since we go through the string of length
N
two times.Space complexity : O(N) since we have to keep a hash map with
N
elements.
#2
Last updated