def firstUniqChar(self, str1):
:type s: str
for x in str1:
Isn't the worst case complexity O(n^2)?
This is a simple solution, but the complexity is pretty bad. The worst case complexity is O(n^2), when a better solution can yield O(n) complexity.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.