All language subtitles for 8. Challenge 2 - Sum of Digits in a Number

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

So in this challenge, what we are going to do is to write the recursive function that first of all,

what it will do is receive a number NUM.

And once it receives these num, all the recursive function task is to find out and return the sum of

all digits.

In this particular number.

So we simply take a given number.

It may of one digit two digits, three digit digits and so on.

And all these function has to do is to find out what will be the sum of all the digits.

So, for example, if we take NUM as 67, then we know that the sum of all of its digits will be six

plus seven, which is a total of 13.

Okay.

And the function, once it's found out, are all the sum of the digits.

The function simply should return 13.

In this example, any a for another example, we have NUM like nine thousand five hundred thirty one.

So the sum of digits is going to be pretty much calculated in the same way.

Right.

Because we use some recursive calls.

We divided to solve problems.

And it doesn't matter for us how many digits there will be in a given number as long as we know the

formula to how to divide it, to solve problems and make our recursive calls.

So in this case, if we want to know that some of these just we will simply sum up nine plus five plus

three plus one, which give us a total off of what it will be, the total of 18.

So that's pretty much the exercise.

We have to write the recursive function.

I know it's kind of tempting to use just thing for a loop to find out what will be the result.

Right.

Because we can use for a loop, so why wouldn't we use it?

Something that we know.

And the reason is very simple, because our task is to practice some recursive approach to find out

how can we divide, to solve problems are some bigger problem, and then to reach some base condition

or a stopping condition and to build up all our way up to find Venus the necessary result.

So take your time, guys.

Think about the solution.

Try to understand what will be the base case.

What will be the recursive calls?

And make me write also the the main function that will check out and makes sure that the recursive function

works as expected.

And then, of course, we are going to solve this exercise together.

So I'll see you there.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.