

You do not need to print anything; it has already been taken care of. Just implement the given function.
Input: N = 234
Output: 15
Explanation:
Product of digits = 2 * 3 * 4 = 24
Sum of digits = 2 + 3 + 4 = 9
Result = 24 - 9 = 15
The first line of input contains a single integer ‘T’ denoting the number of test cases.
The second line contains the integer ‘N’ whose difference between the product and the sum of all the digits need to be calculated.
For each test case print the difference between the product and the sum of all the digits in ‘N’.
You do not need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 3000
1 <= N <= 10^5
Time Limit: 1 sec
The idea here is to traverse through all the digits in the number and keep calculating the product and sum for each digit until the sum and products of all the digits are obtained.
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers