P18185 [GeeksforGeeks] Hexadecimal to decimal counter1627
提高-
题目描述

You are given a number str(in string format) in hexadecimal. A new number can be made from the number str by selecting any subsequence of it (in HexaDecimal) and rearranging it.
You have tell the number of distinct numbers that can be made from number n.

Example 1:
Input: str = "1F"
Output: 4
Explanation: For 1F possible combination are
1, F, 1F, F1.
Example 2:
Input: str = "1FF"
Output: 8
Explanation: For 1FF possible combinations are
1, F, 1F, F1, FF, 1FF, F1F, FF1.

Your Task:
You don't need to read or print anyhthing. Your task is to complete the function countOfDistinctNo() which takes str in string format as input and returns the total possible combination modulo 10^{9}+7.

Expected Time Compelxity: O(L*L) where L is the length of the string str.
Expected Space Complexity: O(L)

Constraints:
1 <= n <= 2^{8000} where n = str in decimal.

输入格式

见题面

输出格式

见题面

样例输入
str = "1F"
样例输出
4