Beautiful Number

Time limit1sMemory limit128 MB

Summary
For each given integer, count how many distinct decimal digits it contains.
Level

Easy1 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

For a positive integer, define its beauty as the number of distinct digits that appear in its decimal representation. Given several integers, compute the beauty of each one.

Input

The first line contains the number of test cases, T. Each of the next T lines contains an integer X whose beauty must be computed.

  • 1 ≤ X ≤ 1,000,000,000

Output

For each test case, print the beauty of X on its own line, in the same order as the input.

Examples1

  1. Example 1

    Input
    2
    7
    122
    
    Expected output
    1
    2