Sir it is showing TLE in one test case ans WA in one. One test case is passed successfully. Can you please the error and how can I optimize it ?
IDE : https://ide.codingblocks.com/s/205920
369 numbers : Digit DP
Sir please reply. I am not able to see your response
you have not handled your tight dp dimension carefully. check it. the value of en will be always 9 for your first digit.
thanks
I am sorry about my previous comment, you have handled tight properly.
the issue is that you missed to include A for interval [A,B] when A is a 369 number.
lets say f(x) is count of 369 numbers from 0 to x, x inclusive.
then for interval [A,B],
ans = { f(B)-f(A) if A is not 369 number,
f(B)-f(A)+1, if A is 369 number.}
you forgot the later case.
Its been too long for this doubt. I am resolving this doubt. we can further talk in chat if you are still not satisfied.
thanks
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.