All language subtitles for 19. Advanced - Odd Even Positions and Values Finder - 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
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, what is going on, ladies and gentlemen, and welcome to another very interesting yeah,

not so easy exercise using recursions.

And in this video, in this exercise, what you are going to do is basically to write some very nonintuitive

function.

And it's going to simply do to take you now, hopefully to to the next level, because this exercise

is very not straightforward.

And actually I kind of consider it to be much more complex than the previous exercises, at least then

the exercises you solved at the beginning of this section.

So without further ado, let us start working.

So what do you have to do in these exercises to write a function, a recursive function, so write a

recursive function that gets some, I don't know, natural number and at least function basically should

be, first of all, a recursive function and it should get some natural number.

And OK, so far, so good.

And now what the function has to do is let's say you have some number and you also know that this number

is compromised of digits.

Let's say I don't know and equals two, three, six, four, three, five, OK, something like that.

And you know that this is a number and this number is compromised of digits.

So you have the digit at index zero.

OK, well, we'll start from right to left.

OK, so the position of each digit in a number, we will assume that it has some index that we will

be able to refer to.

I don't know if index is the appropriate word for it, but let's say position.

OK, so a digit has a position and we start the position right from zero.

OK, so these five is a budget position zero.

This three is a digit at position one.

These four is a digit at position two and so on and so forth.

So let's just write it down because that's an example.

I'm trying to build it and to explain it also to you as we go so and equals two, three, six, four,

three, five.

So we will say that position zero, the number is five.

Position one, the number is three position position to the number four.

Position three, the number is six.

And position polarization for the number is three.

OK.

Awesome.

So that's basically of introduction to what we are going to do in this exercise.

So we get some number and it's a natural number.

And what we want to do is to make sure that every digit OK in a are in an even location has an even

value.

OK, and also that every digit in an odd location has an odd value.

OK, so for example, if you have this number, OK, so three six four three five, we will look at

all of its digits.

So we will start with digit with the first digit at position zero and we see that the position is even

but the number itself, the value is odd.

OK, and our position one, the position itself is odd and the value is also odd.

So we want this function to return return one.

If every digit

gets a at and even position has an even value as well as every digit at an odd position has an odd value.

Otherwise return zero.

OK, so that's otherwise.

And basically, what I mean by that is that for this example, the result will be zero because not every

even position there is an even value.

OK, so this is an even position, but the value is odd.

So that's very simple.

The result should be false, basically should be zero.

So let's see another example and let's say we have, I don't know, some simpler, simpler example.

So example number two, and it goes like this.

So for three and let's say eight.

So position zero has a value of eight.

Position one has a value of three and position two has a value of four.

And in this case, we will see that an even position, the reason even value it, even position there

is an even value and also at all the position, we have an odd value.

OK, so that's basically what we have for this example example, number two will have like return one

and for the first example, we will have to return zero.

OK, so that's the exercise.

Not so easy, not so trivial.

You have somehow to distinguish between many different options and many different possible numbers that

you have to take care of and how basically you find this position using some recursive approach, although

the the Terentiev approach using sound for a while loop, many seem a little bit easier to solve this

exercise, but that's not what we are here for.

Basically, we are here to solve it on using the recursive approach, the recursive concept and using

this recursive recursion function.

OK, so think about it, how you can solve it even even.

I don't know.

Let's try even to take a few hours.

If you still don't get like the perfect result that works for all of the numbers you are trying for

all of the natural numbers you were trying either.

These numbers are going to be one digit, two digits, three digits, five digits and so on and so forth.

OK, so take some time.

Think about it, even if you can solve it in a few hours.

Don't leave this exercise.

Don't jump straight to the solution.

Try to solve it on your own.

It's very important that it's not a trivial that's not an easy exercise and it's mandatory for you to

give it a shot on your own and to try to become a better programmer, because that's the process and

that's the way guys who.

So I hope everything is clear to you.

Let me know if you have any questions about this exercise and hopefully you will manage to solve it

on your own and then to compare it with my solutions.

If not, of course.

Please, after that, take the solutions video and make sure that everything is clear to you and that

you are capable of proceeding further.

So thank you guys for watching.

My name is what this is Alphatech and we are going to solve it together.

So let's go.

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