12527 - Different Digits
Solution Description : Array pre-genrate problem Set ans[0]=0 for i=1 to 5000 ----if i contain repeated digit then set ans[i] = ans[i-1] ----else set ans[i] = ans[i-1] + 1 for input n and m just print (ans[m] - ans[n-1) |
||||||||||
12527 - Different Digits
Solution Description : Array pre-genrate problem Set ans[0]=0 for i=1 to 5000 ----if i contain repeated digit then set ans[i] = ans[i-1] ----else set ans[i] = ans[i-1] + 1 for input n and m just print (ans[m] - ans[n-1) |
||||||||||