atcoder#SUMITB2019D. Lucky PIN
Lucky PIN
Score: points
Problem Statement
AtCoder Inc. has decided to lock the door of its office with a -digit PIN code.
The company has an -digit lucky number, . Takahashi, the president, will erase digits from and concatenate the remaining digits without changing the order to set the PIN code.
How many different PIN codes can he set this way?
Both the lucky number and the PIN code may begin with a .
Constraints
- is a string of length consisting of digits.
Input
Input is given from Standard Input in the following format:
Output
Print the number of different PIN codes Takahashi can set.
4
0224
3
Takahashi has the following options:
- Erase the first digit of and set
224
. - Erase the second digit of and set
024
. - Erase the third digit of and set
024
. - Erase the fourth digit of and set
022
.
Thus, he can set three different PIN codes: 022
, 024
, and 224
.
6
123123
17
19
3141592653589793238
329