- Time limit: 1.00 s
- Memory limit: 256 MB
You are given a string that consists of letters A..Z.
Your task is to remove all but four letters, so that the remaining letters form the word "HIIT". You cannot change the order of the letters.
How many ways there are to do this?
The first input line contains an integer t: the number of test cases.
After this, t lines follow. Each line contains a string of n letters.
For each test case, output the number of ways to form the word "HIIT".
- 1 \le t \le 100
- 1 \le n \le 10^5
- the sum of all n values is at most 10^6
3 HXIIYT AYBABTU HIITHIIT
1 0 8