


Input: 'X' = 2
Output: 1
As only one digit is ‘2’ present in ‘X’ so answer is ‘1’.
The first line will contain the integer 'T', denoting the number of test cases.
Each test case contains a single long integer ‘X’.
For each test case, print the number of digits in the given integer ‘X’.
You don't need to print anything. It has already been taken care of. Just implement the given function.
1 <= 'T' <= 1000
1 <= ‘X’ <= 10^18
Time Limit: 1 sec
We will remove the least significant digit from the given integer by dividing it by 10 until the number does not become zero. The number of times we can perform the above operation is the answer.
Algorithm :
This approach is the shorter version of the iterative approach. We know that number of times we can delete the least significant digit from the number is the same as the number of times it can divide ‘10’. So the answer will be simply ‘floor( log10(X) + 1 )’.