All Tracks Problem

Aditya's Love for Strings
/

String Algorithms

Problem
Editorial
Analytics

Aditya is a professor in Engilsh loves to play with words. Today he asks his assistant Abishek to perform an experiment where he wants him to calculate the total number of word that can be formed from a given word such that the characters are arranged lexicographically(in alphabetical order). The words that are to be formed can start with any of the alphabets present in the word and the generated word cannot contain a single alphabet twice given by the professor.

Abishek visit you as their professor for Computer Science to help them by writing a code that would calculate the same.

INPUT:

First line contains the no of test cases, N<1000 Next N lines contains Strings of length L<1000000

OUTPUT:

N Lines containing the no of words formed in each test case

SAMPLE INPUT
3
ankit
aman
cvrcebhubaneswar
SAMPLE OUTPUT
5
3
11
Explanation

For 1st String ankit

The words Formed are:

aiknt iknt knt nt t

For aman

amn mn n

Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

This Problem was Asked in

Initializing Code Editor...
Notifications
View All Notifications

?