标签:1出现的次数 cme while describe ret code sel == coding
# -*- coding:utf-8 -*- class Solution: def NumberOf1Between1AndN_Solution(self, n): # write code here ones,m =0,1 if not n: return 0 while m<=n: ones += (n//m+8)//10*m + (n//m%10==1)*(n%m+1) m *= 10 return ones
标签:1出现的次数 cme while describe ret code sel == coding
原文地址:https://www.cnblogs.com/277223178dudu/p/10563160.html