Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.

book
Finding Distinct Letters in a Set

Bill has found a set. The set consists of small English letters. Bill carefully wrote out all the letters from the set in one line, separated by a comma. He also added an opening curved bracket at the beginning of the line and a closing curved bracket at the end of the line. Unfortunately, from time to time Bill would forget writing some letter and write it again. Help Bill to count the total number of distinct letters in his set.

Given a string of set format set_str, return an integer of total number of distinct letters from set.

Example 1

Input:

{b, a, b, a}

Output:

2
main.cpp

main.cpp

C++

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt