Getting TLE on intconca (starters rated for div2 , 3 )

i have used 2 binary searches for finding out the left most and the rightmost numbers which on concatenation lies in range [l,r] . binary search is logN and my overall complexity should be NlogN which in my opinion should work for n=10^6 , but i am getting TLE , can anyone point out my mistake ?
my submission Solution: 52387346 | CodeChef