Count the number of 2s as digit in all numbers from 0 to n.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains the input integer n.
Print the count of the number of 2s as digit in all numbers from 0 to n.
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.