← Back to challenges

Total Number of Unique Characters

PythonHardstringsdata_structures

Instructions

Given two strings, create a function that returns the total number of unique characters from the combined string.

Examples

count_unique("apple", "play") ➞ 5
# "appleplay" has 5 unique characters:
# "a", "e", "l", "p", "y"

count_unique("sore", "zebra") ➞ 7

count_unique("a", "soup") ➞ 5

Notes

  • Each word will contain at least one letter.
  • All words will be lower cased.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Who's in First Place?