Product of pieces
Statement
Goal
Count the occurrences of each character and output the product of said occurrences.ex(sample1): AABBCC
A is 2, B is 2, C is 2, so answer is 8(=2*2*2).
Input
S is given in one line.
S consists of alphanumeric characters.
S consists of alphanumeric characters.
Output
Output a single number of the product of them.
Constraints
1 <= |S| <= 50
Example
Input
AABBCC
Output
8
Game modes
Fastest, Shortest
Test cases
Test 1 Test
Input
AABBCC
Output
8
Validator 1 Validator
Input
AAABBBCCC
Output
27
Test 2 Test
Input
aaAABBbb0011
Output
64
Validator 2 Validator
Input
aaaabbCCC1111222
Output
288
Test 3 Test
Input
ababCCCDDSSD
Output
72
Validator 3 Validator
Input
asasdudu00000
Output
80
Test 4 Test
Input
AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEE
Output
100000
Validator 4 Validator
Input
ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDD
Output
99000
Solution language
Solution
Stub generator input