class Solution:
def NumberOf1Between1AndN_Solution(self , n: int) -> int:
# write code here
count = 0
for i in range(1,n+1):
count_1 = str(i).count('1')
count = count + count_1
return count

京公网安备 11010502036488号