Leetcode 387. First Unique Character in a String
Return the index of the first character in s that occurs exactly once (or -1 if none). This is typically solved by counting character frequencies then scanning for the first char with count 1 — O(n) time and O(1) extra space for lowercase letters.
Asked at:
Goldman Sachs
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late September, 2026
Goldman Sachs
Senior
You'll be given a string and you want to find the character which has has only one occurence in the string.For multiple such characters, return the earliest occuring one. If no such character is there return -1. eg. in "adcbccpq", d is the answer
Late September, 2025
Goldman Sachs
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.