fork download
  1. # your code goes here
  2. from collections import Counter
  3. c = Counter()
  4. for i in range(100000):
  5. s = sum(int(c) for c in str(i))
  6. c[s] += 1
  7. print(c)
Success #stdin #stdout 0.29s 9532KB
stdin
Standard input is empty
stdout
Counter({22: 6000, 23: 6000, 21: 5875, 24: 5875, 20: 5631, 25: 5631, 19: 5280, 26: 5280, 18: 4840, 27: 4840, 17: 4335, 28: 4335, 16: 3795, 29: 3795, 15: 3246, 30: 3246, 14: 2710, 31: 2710, 13: 2205, 32: 2205, 12: 1745, 33: 1745, 11: 1340, 34: 1340, 10: 996, 35: 996, 9: 715, 36: 715, 8: 495, 37: 495, 7: 330, 38: 330, 6: 210, 39: 210, 5: 126, 40: 126, 4: 70, 41: 70, 3: 35, 42: 35, 2: 15, 43: 15, 1: 5, 44: 5, 0: 1, 45: 1})