wes d2a2ba9e15 first commit | 4 jaren geleden | |
---|---|---|
.. | ||
README.md | 4 jaren geleden | |
code.cpp | 4 jaren geleden | |
unitTest.cpp | 4 jaren geleden |
by Helen Yu tags: strings, data_structures
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 // "sorezebra" has 7 unique characters: // "a", "b", "e", "o", "r", "s", "z" countUnique("a", "soup") ➞
Given two strings, create a function that returns the total number of unique characters from the combined string.
countUnique("apple", "play") ➞ 5
// "appleplay" has 5 unique characters:
// "a", "e", "l", "p", "y"
countUnique("sore", "zebra") ➞ 7
// "sorezebra" has 7 unique characters:
// "a", "b", "e", "o", "r", "s", "z"
countUnique("a", "soup") ➞ 5