class Solution:

    def findNthDigit(self, n: int) ->int:
        k, l, cnt = 1, 1, 9
        while n > cnt:
            n -= cnt
            k *= 10
            l += 1
            cnt = 9 * k * l
        n -= 1
        q, r = n // l, n % l
        k += q
        return int(str(k)[r])

53471d8f7241403eb3a041fd408387835fe90d4f
<mask token>

class Solution:
    <mask token>

class Solution:

    def findNthDigit(self, n: int) ->int:
        k, l, cnt = 1, 1, 9
        while n > cnt:
            n -= cnt
            k *= 10
            l += 1
            cnt = 9 * k * l
        n -= 1
        q, r = n // l, n % l
        k += q
        return int(str(k)[r])
