Hexadecimal to decimal counter
Submissions: 347   Accuracy:

11.07%

  Difficulty: Hard   Marks: 8

You are given a number n in hexadecimal. A new number can be made from the number n 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.
Since the answer will be very large, output the answer as modulo 10^9+7.

Input:
First Line Consist of T - number of test cases.  Only line of the test case contains a single line containing the input number in hexadecimal

Output
Print the desired output.

Constraints:
1<=T<=10

n<=2^8000 (n in decimal)

Example:
Input:

2
1F
1FF

Output:
4
8

Explanation:

For 1FF possible combinations are - 1,F,1F,F1,FF,1FF,F1F,FF1

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: jain_rishabh


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.