Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Count Unique Characters in a String

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Count Unique Characters in a String. Start with the requirements on the right.

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.

Problem

Given a string s, write a function to count the number of unique characters in it. The function should ignore spaces and consider uppercase and lowercase letters as the same character.

Constraints

  • 1 <= s.length <= 100
  • s consists of printable ASCII characters

Function Signature

def count_unique_characters(s):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output