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 54%
+34
youbastard
mathis
dmarkenstein
SephQ
dreimert
SXW172P_thdgit
oskar
Tony
Natanaelel
danielgjackson
#2
26 c.
Top 59%
Salutations45
val
CatsAreFluffy
Thomas
#3
27 c.
Top 63%
randolchance
AlephSquirrel
olivernybo
Yewzir
#4
28 c.
Top 67%
aymeric-agre
L
cers
#5
31 c.
Top 68%
Seboran
#6
32 c.
Top 71%
Logicer
jonny713
#7
33 c.
Top 72%
coldcoffeee
#8
34 c.
Top 79%
Europe2048
team
josex2r
TooBusyForYou
Guillaume
chalda-pnuzig
#9
35 c.
Top 83%
Chimerion86
Pascal
emma
#10
36 c.
Top 84%
darcyclarke
#11
37 c.
Top 85%
Ryan
#12
38 c.
Top 88%
ComputerKWasTaken
goodwyna21
#13
39 c.
Top 91%
NotAMojangDev
cabz0r
chester
#14
42 c.
Top 93%
moherik
#15
45 c.
Top 95%
tdopierala
Vincent
#16
47 c.
Top 98%
yoyozbi
tidoni
#17
49 c.
Top 99%
Scott
#18
287 c.
Top 100%
Sidd5arth