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%
+52
XenThe
two-bad
shawn-walcher
maximec-indy
marc-indy
Jisu
Adrien1605036937
Shanethegamer
davyboyh
Kasper
#2
26 c.
Top 59%
targrik
Thomas
CatsAreFluffy
Ryan
val
#3
27 c.
Top 63%
Yewzir
olivernybo
SantYalSAuDATiOX
AlephSquirrel
randolchance
#4
28 c.
Top 66%
L
aymeric-agre
cers
#5
31 c.
Top 68%
shawnmcla
Seboran
#6
32 c.
Top 69%
jonny713
Logicer
#7
33 c.
Top 70%
coldcoffeee
#8
34 c.
Top 77%
CaporalDead
Guillaume
TooBusyForYou
josex2r
Europe2048
team
vaibhavbshete
chalda-pnuzig
#9
35 c.
Top 80%
Pascal
emma
Chimerion86
#10
36 c.
Top 82%
thaispalmer
darcyclarke
#11
37 c.
Top 82%
Ninluc
#12
38 c.
Top 85%
ComputerKWasTaken
Lucas5825343024
goodwyna21
#13
39 c.
Top 88%
cabz0r
NotAMojangDev
chester
#14
40 c.
Top 89%
denitsapavlova13
#15
41 c.
Top 89%
Mif712
#16
42 c.
Top 90%
moherik
#17
45 c.
Top 92%
Vincent
tdopierala
#18
47 c.
Top 95%
Michael5736614216
yoyozbi
tidoni
#19
49 c.
Top 96%
Scott
#20
63 c.
Top 96%
Haiko
#21
75 c.
Top 97%
c
#22
85 c.
Top 98%
ALefrancois27
#23
160 c.
Top 99%
Luke
#24
287 c.
Top 100%
Sidd5arth