Hello codeforces :D
I was trying to solve this problem
and I got TLE , I tried to solve it using DP.
my approach for this problem , first I find how many 369 are there in the interval [ 1 , B ] , let this value be right
then I find how many 369 are there in the interval [ 1 , A ] , let this value be left
my final answer will be right — left , if A is not 369 number
else it will be : right — left + 1
here is my code
can I do some pre calculations to avoid TLE ?
thank in advance :D



