Digi-sum

Sum all the digits of an integer.

Easy12/15/2023

Problem statement

Given a string representing an positive integer, return the sum of all the digits of that integer.

Problem leaderboard

#
Size
%
Users
#1
25 c.
Top 55%
+34
Thomasdcrt
Kacarott
two-bad
dmarkenstein
SephQ
Tony
sean
alexisab
tree
CorentinTh
#2
26 c.
Top 60%
Salutations45
CatsAreFluffy
Thomas
val
#3
27 c.
Top 65%
AlephSquirrel
randolchance
Yewzir
olivernybo
#4
28 c.
Top 69%
cers
L
aymeric-agre
#5
31 c.
Top 70%
Seboran
#6
32 c.
Top 73%
Logicer
jonny713
#7
33 c.
Top 74%
coldcoffeee
#8
34 c.
Top 81%
Guillaume
team
chalda-pnuzig
josex2r
Europe2048
TooBusyForYou
#9
35 c.
Top 85%
Chimerion86
Pascal
emma
#10
36 c.
Top 86%
darcyclarke
#11
37 c.
Top 88%
Ryan
#12
38 c.
Top 90%
ComputerKWasTaken
goodwyna21
#13
39 c.
Top 94%
NotAMojangDev
cabz0r
chester
#14
45 c.
Top 96%
Vincent
tdopierala
#15
47 c.
Top 99%
yoyozbi
tidoni
#16
49 c.
Top 100%
Scott