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