Assume an infinite string concatenating all natural numbers: 1234567891011121314...
Write a function that receives an arbitrary string of digits and returns the position of its first occurence within the infinite number string.
- input "12" should return 0 because it appears directly at the beginning,
- "10" should return 9 because if follows after "123456789",
- "445" should return 79 because the first occurence is in the sequence ..434445.. with 79 digits before
It is a codewars kata of rank 2 (second most difficult), see https://www.codewars.com/kata/582c1092306063791c000c00
This is my solution of the task.