Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Unique Character From String
00:00
5 left

Unique Character From String

EasyPython

Problem

Write a solution to find the unique character from a string. Treat a character as unique when it appears exactly once, and return the first such character in the original order. Implement find_unique_character(s), where s is a string and the result is that character or "" when no unique character exists.

Constraints

  • 0 <= len(s) <= 1000
  • The string may contain letters, digits, spaces, and punctuation
  • Character comparisons are case-sensitive
  • Return the first character whose frequency is exactly one

Function Signature

def find_unique_character(s):
Interviewer

Your question is Unique Character From String. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.