```
class Solution(object):
def findNthDigit(self, n):
"""
:type n: int
:rtype: int
"""
i = 1
while n > 9*i*pow(10,i-1):
n = n - 9*i*pow(10,i-1)
i += 1
index = (n-1) % i
num = (n-1)//i+ pow(10,i-1)
return int(str(num)[index])
```