Suppose i have been given a number 54432 .How to count all numbers less than 54432 and having last two digits as 1 ? i.e all the numbers of form xxx11 and xxx11 < 54432 .Here x can be any digits but xxx11 < 54432 should hold.
What is count of all the numbers of form x11xx and x11xx < 54432 ?
How to solve this in general and fast way i.e any number other than 1 , say y and arbitrary position of two contiguous digits as y and count of all such numbers less than a given integer.
can we solve this problem using strings ?
Like for 54411 , total count is 545 . Just remove 11 part and add 1. for 54112 ,total count is 543 , just remove 11 part .