打卡记录 第 N 位数字(找规律) 链接 class Solution: def findNthDigit(self, n: int) -> int: count, digit, start = 9, 1, 1 while n > count: n -= count digit += 1 start *= 10 count = start * 9 * digit num = start + (n - 1) // digit return int(str(num)[(n - 1) % digit])