My mistake (I’ve edited the previous comment), I meant for digit in 501st number - 1394, but that’s not making your algorithm quicker
yes, because, i have appended upto 500 only, so that we can not get the index of the next integer., and i am giving output as “index out of bound” in such situations
@rajasekharcool and @sumanth_puri can you please specify why you down voted my answer, is there problem in description or is it only because I down voted your slow solutions?
On my PC code for input 100.000 (10^5) and 480.000 (48*10^4) returns answer in 15 seconds.
because…, i am unable to estimate the running time with ur description., so if u provide ur code., we can try to do…
This one is not working, maybe you can describe your approach, but expected result for inputs 1393, 1394 and 1395 is 5, 0 and 1, your code returns 1, 4, 9 - coIv3I - Online C++ Compiler & Debugging Tool - Ideone.com
I added the link to my algorithm
I added the link to my algorithm It runs for 10^18 in less than 0.1s
I added link to the algorithm, it can find the result for 10^18 in less than 0.1s
index = [0,10^18]