Help in a DP problem

Revision en1, by rsazid99, 2017-11-25 15:46:13

Jimmy writes down the decimal representations of all natural numbers between and including m and n, (m ≤ n). How many zeroes will he write down?

Input Input starts with an integer T (≤ 11000), denoting the number of test cases.

Each case contains two unsigned 32-bit integers m and n, (m ≤ n).

Output For each case, print the case number and the number of zeroes written down by Jimmy.

Sample Input Output for Sample Input 5 10 11 100 200 0 500 1234567890 2345678901 0 4294967295 Case 1: 1 Case 2: 22 Case 3: 92 Case 4: 987654304 Case 5: 3825876150

what will be the dp states ? as i used the concept of Digit dp , so my states are dp[my current position][my last number][is the number started][is my current digit equal to my target digit] but i am getting correct output for 1st 3 cases, is there anything i am missing ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English rsazid99 2017-11-25 15:55:33 4 Tiny change: 'le Input\n5\n10 11\n\' -> 'le Input\n\n5\n\n10 11\n\'
en2 English rsazid99 2017-11-25 15:46:57 20
en1 English rsazid99 2017-11-25 15:46:13 873 Initial revision (published)