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 58%
+25
Rusty
sean
marc-indy
Jisu
danielgjackson
Thomasdcrt
two-bad
KrausRaus
Natanaelel
rucin93
#2
26 c.
Top 63%
CatsAreFluffy
Thomas
val
#3
27 c.
Top 70%
AlephSquirrel
Yewzir
randolchance
olivernybo
#4
28 c.
Top 73%
cers
L
#5
31 c.
Top 75%
Seboran
#6
32 c.
Top 77%
jonny713
#7
33 c.
Top 78%
coldcoffeee
#8
34 c.
Top 85%
TooBusyForYou
chalda-pnuzig
Guillaume
team
#9
35 c.
Top 90%
emma
Chimerion86
Pascal
#10
36 c.
Top 92%
darcyclarke
#11
37 c.
Top 93%
Ryan
#12
38 c.
Top 95%
ComputerKWasTaken
#13
39 c.
Top 98%
chester
cabz0r
#14
45 c.
Top 100%
tdopierala