First Non-Repeated Character
Updated
Problem statement
Given a string s, return the first character whose total frequency in the complete string is exactly one.
Character comparison is case-sensitive. Return the empty string when no character occurs exactly once.
Function
firstNonRepeatedCharacter(s: String) → StringExamples
Example 1
s = "swiss"return = "w"The first s repeats, while w appears once and is encountered before i.
Example 2
s = "aabbcc"return = ""Every character repeats, so there is no qualifying result.
Constraints
0 <= s.length <= 10^5.- Every character is printable ASCII.
More Dell Technologies interview questions
Similar questions at other companies
- Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
- Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
- First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
- Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
- Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
- Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
- Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions
- Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
- First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
- SimpleRDD Word CountDatologyAI · PHONE SCREEN