fork download
  1. def zcount(n):
  2. s = 0
  3. length = len(str(n))
  4. for i in range(1,length-1):
  5. s += i*9
  6. for i in range(0,length):
  7. s += int(str(n)[i])*(length-i-1)
  8. return s
Success #stdin #stdout 0.01s 7892KB
stdin
Standard input is empty
stdout

Standard output is empty