':type n: int
:rtype: int'

def findNthDigit(self, n):

    digit_len = 1
    while (n > ((digit_len * 9) * (10 ** (digit_len - 1)))):
        n -= ((digit_len * 9) * (10 ** (digit_len - 1)))
        digit_len += 1
    num = ((10 ** (digit_len - 1)) + ((n - 1) / digit_len))
    nth_digit = (num / (10 ** ((digit_len - 1) - ((n - 1) % digit_len))))
    nth_digit %= 10
    return nth_digit
