Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Count Unique Characters in a String
00:00
5 left

Count Unique Characters in a String

EasyPython

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):
Interviewer

Your question is Count Unique Characters in a 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.