hello I am stuck in this problem Digit Queries.I think I need to use recursion here although not quite sure how? Which algo or technique I need to study to solve this problem? **Also please share similar types of problems from other ojs**.Please help me with that.

simple constructive algorithms is enough to solve this

This string contains numbers, numbers contain digits.

Note: summary length of all n-digit numbers is easy to calculate.

more detailed solutionSo you firstly brute force the length(L) of number, where your digit took place.

Also this sum grows fast, so L < 18, so L-digit number fits in 64-bit numbers.

Then you have position of first L-digit number. Now it's easy to find in what L-digit number your digit is.

Then you have L-digit number and position of digit, you just output this digit of L-digit number.

Thanks

Hello,

here my code: https://cses.fi/paste/f1e04f128ac4fe471ae4e1/ however, my code passed only two first test cases. I don't know what wrong with my code.

Here are test cases' result

Please help me to point what's wrong. thank you.

this problem is same as Digits Sequence

thank you

I've submitted the same code as on cses.fi and it worked!. I don't know why it fails on cses.

https://codeforces.com/contest/1177/submission/108590612

Good Constructive Algorithm question! Here is my descriptive solution (https://ideone.com/4yYbq4)

Thank you!