Total Number of Unique Characters

Published by rubens in

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

Examples

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

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

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

Notes

  • Each word will contain at least one letter.
  • All words will be lower cased.
Watch a quick demo on how Edabit works.