Back to problems

First Unique Element III

Algorithm · Goldman Sachs · Easy

Requirements Input: one string. Return the earliest character that occurs only once across the entire string. If the string has no character with frequency one, return an empty string (""). Examples Input: "swiss" Output: "w" Explanation: s appears three times, while w appears once and is the first character with a total count of one. Input: "aabbcdde" Output: "c" Explanation: Both a and b repeat, and c is the first character that occurs exactly once. Constraints The input…

Checking your access…