Given a set-like list of lowercase letters inside braces, count how many distinct letters appear.
You are given a string that represents a collection of lowercase Latin letters inside curly braces, with commas separating the letters. Your task is to determine how many different letters appear in the collection.
The same letter may appear multiple times in the input, but it should be counted only once.
Return the number of unique lowercase letters present in the string.
{a, b, c}.Example 1
Input
{a, b, c}Output
3
Explanation
The distinct letters are a, b, and c.
Example 2
Input
{a, a, b, c, c}Output
3
Explanation
Repeated letters are counted once, so the distinct letters are a, b, and c.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.