```
class Solution(object):
def findNthDigit(self, n):
"""
:type n: int
:rtype: int
"""
n = n - 1
for digit in range(1, 11):
pre = 10 ** (digit - 1)
if n < 9 * pre * digit:
return int(str(pre + n / digit)[n % digit])
n -= 9 * pre * digit
```