

The first line of input contains an integer ‘T’ denoting the number of test cases.
The first and only line of the test case consists of a single integer ‘N’.
Return the total number of one digit.
1 <= ‘T’ <= 11
1 <= ‘N’ <= 10^9
Time Limit: 1 sec
You do not need to print anything, it has already been taken care of. Just implement the given function.
The main idea is to run a loop from 0 to N and count the number of ones for every integer from 0 to N.
Algorithm :
We will use digit dp to count the number of ones from 0 to N.To know more about digit dp refer to this https://codeforces.com/blog/entry/53960
We will create dp with state dp[Index][Total][Check] such that:
The state dp[index][total][check] will tell about the total number of ones possible from the current index to the rightmost index according to the check condition.
Algorithm :