All language subtitles for 29. Extra Recursion 5 - Even_Odd Count of Digit Occurrences in num - Question

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
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

Okey, dokey.

So in this exercise, what you are required to do is to develop a recursive function that receives an

integer numb.

OK, so probably the signature of the function is going to include enum.

OK, now is the name of the variable end is the type of the variable.

And also these function is going to receive not only numb, but also these function is going to receive

a digit.

OK, so function is going to receive two things.

One is numb and two is digit.

And this digit should represent basically any value between zero up to nine.

OK, so zero one two three four five six seven eight nine.

And the non variable can be basically whatever name you can think about.

It can be of one digit to the digits, three digits and even seven digits.

All right.

So that's basically about what the function receives.

But why aren't these recursive functions should do?

All it has to do is that these functions should return to options.

It can return either a zero or one.

That's it.

Only two options.

The function is going to return one if the count of digit occurrences in NAM is even meaning if we have.

We are basically going to go over each digit in our name and compare it with the actual digit that we

received.

And if the total count of digit occurrences in NAM will be even, then this function is going to return

one.

Otherwise, the function is going to return zero.

Meaning if the number of digit occurrences in NAM itself is odd, then the function is going to return

zero.

So, for example, let's take a look at basic examples like this one.

If we have no equals to twenty 124 and we have digit equals to two.

OK, so now equals to one hundred and twenty four digit equals to two.

That's one of the function received, and we are going to count how many times digit appears inside

of these number.

Digit number equals to two.

In this case, we know that digit appears only once.

So that means number or a total count of occurrences equals to one.

That means it's an odd value.

And that's why the function is expected to return the value of zero.

Also, if we have another name, let's say, one two, three, four two and the digit equals again to

two.

Then we count how many times we have the how many occurrences of the digit we have inside of NAM, and

we see that there is the first time in there is the second time, meaning a total of two times.

That means that the function has two occurrences of the digits inside number.

That's why two occurrences is an even number of occurrences.

That's why the function is going to return one and also the same here.

If we get the digit of zero and we see like one, two, three and four times the digit four occurrences

even.

And that's why we return one.

So these are the instructions to develop a recursive function.

Make sure you're not used the interactive approach of using loops for loops while loops don't use it.

Probably because we need to develop a recursive function that will work with the recursion concept.

OK, so with that being said, now is your time.

Now is your turn to try and develop the use function on your own.

And until the solutions VIDEO Keep on practicing, practice this, get better and become the best programmers

you can be until the next time.

My name is Vlad Lisa's alphabet.

I'll see you in the next video.

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