All language subtitles for 19. Advanced - Odd Even Positions and Values Finder - Question

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
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
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,500 --> 00:00:09,320 Okey dokey, what is going on, ladies and gentlemen, and welcome to another very interesting yeah, 2 00:00:09,560 --> 00:00:14,090 not so easy exercise using recursions. 3 00:00:15,140 --> 00:00:22,910 And in this video, in this exercise, what you are going to do is basically to write some very nonintuitive 4 00:00:22,910 --> 00:00:23,630 function. 5 00:00:24,140 --> 00:00:33,740 And it's going to simply do to take you now, hopefully to to the next level, because this exercise 6 00:00:33,740 --> 00:00:35,680 is very not straightforward. 7 00:00:35,690 --> 00:00:44,870 And actually I kind of consider it to be much more complex than the previous exercises, at least then 8 00:00:44,870 --> 00:00:48,970 the exercises you solved at the beginning of this section. 9 00:00:49,580 --> 00:00:55,220 So without further ado, let us start working. 10 00:00:56,450 --> 00:01:04,970 So what do you have to do in these exercises to write a function, a recursive function, so write a 11 00:01:05,000 --> 00:01:17,570 recursive function that gets some, I don't know, natural number and at least function basically should 12 00:01:17,570 --> 00:01:22,010 be, first of all, a recursive function and it should get some natural number. 13 00:01:22,010 --> 00:01:24,110 And OK, so far, so good. 14 00:01:25,140 --> 00:01:34,770 And now what the function has to do is let's say you have some number and you also know that this number 15 00:01:34,800 --> 00:01:36,800 is compromised of digits. 16 00:01:36,840 --> 00:01:44,550 Let's say I don't know and equals two, three, six, four, three, five, OK, something like that. 17 00:01:45,090 --> 00:01:50,790 And you know that this is a number and this number is compromised of digits. 18 00:01:51,690 --> 00:01:55,950 So you have the digit at index zero. 19 00:01:55,980 --> 00:01:58,420 OK, well, we'll start from right to left. 20 00:01:58,440 --> 00:02:06,210 OK, so the position of each digit in a number, we will assume that it has some index that we will 21 00:02:06,210 --> 00:02:07,360 be able to refer to. 22 00:02:08,130 --> 00:02:12,550 I don't know if index is the appropriate word for it, but let's say position. 23 00:02:12,570 --> 00:02:19,560 OK, so a digit has a position and we start the position right from zero. 24 00:02:19,590 --> 00:02:24,120 OK, so these five is a budget position zero. 25 00:02:24,270 --> 00:02:27,630 This three is a digit at position one. 26 00:02:27,810 --> 00:02:33,200 These four is a digit at position two and so on and so forth. 27 00:02:33,210 --> 00:02:36,570 So let's just write it down because that's an example. 28 00:02:36,870 --> 00:02:44,370 I'm trying to build it and to explain it also to you as we go so and equals two, three, six, four, 29 00:02:44,370 --> 00:02:45,100 three, five. 30 00:02:45,900 --> 00:02:50,790 So we will say that position zero, the number is five. 31 00:02:51,300 --> 00:02:59,820 Position one, the number is three position position to the number four. 32 00:03:00,120 --> 00:03:04,410 Position three, the number is six. 33 00:03:04,770 --> 00:03:10,380 And position polarization for the number is three. 34 00:03:10,590 --> 00:03:10,980 OK. 35 00:03:11,880 --> 00:03:12,430 Awesome. 36 00:03:12,450 --> 00:03:17,240 So that's basically of introduction to what we are going to do in this exercise. 37 00:03:17,340 --> 00:03:20,520 So we get some number and it's a natural number. 38 00:03:20,730 --> 00:03:32,880 And what we want to do is to make sure that every digit OK in a are in an even location has an even 39 00:03:32,880 --> 00:03:33,690 value. 40 00:03:33,840 --> 00:03:42,060 OK, and also that every digit in an odd location has an odd value. 41 00:03:42,240 --> 00:03:51,360 OK, so for example, if you have this number, OK, so three six four three five, we will look at 42 00:03:51,390 --> 00:03:53,190 all of its digits. 43 00:03:53,320 --> 00:04:01,130 So we will start with digit with the first digit at position zero and we see that the position is even 44 00:04:01,260 --> 00:04:04,710 but the number itself, the value is odd. 45 00:04:04,900 --> 00:04:12,180 OK, and our position one, the position itself is odd and the value is also odd. 46 00:04:12,600 --> 00:04:17,610 So we want this function to return return one. 47 00:04:18,120 --> 00:04:20,550 If every digit 48 00:04:23,010 --> 00:04:42,420 gets a at and even position has an even value as well as every digit at an odd position has an odd value. 49 00:04:43,020 --> 00:04:46,320 Otherwise return zero. 50 00:04:46,440 --> 00:04:48,300 OK, so that's otherwise. 51 00:04:49,840 --> 00:04:57,880 And basically, what I mean by that is that for this example, the result will be zero because not every 52 00:04:57,910 --> 00:05:00,880 even position there is an even value. 53 00:05:01,080 --> 00:05:05,420 OK, so this is an even position, but the value is odd. 54 00:05:05,440 --> 00:05:06,870 So that's very simple. 55 00:05:06,880 --> 00:05:10,790 The result should be false, basically should be zero. 56 00:05:11,080 --> 00:05:17,320 So let's see another example and let's say we have, I don't know, some simpler, simpler example. 57 00:05:17,320 --> 00:05:20,190 So example number two, and it goes like this. 58 00:05:20,200 --> 00:05:23,760 So for three and let's say eight. 59 00:05:24,640 --> 00:05:27,130 So position zero has a value of eight. 60 00:05:27,370 --> 00:05:31,150 Position one has a value of three and position two has a value of four. 61 00:05:31,570 --> 00:05:38,500 And in this case, we will see that an even position, the reason even value it, even position there 62 00:05:38,560 --> 00:05:43,600 is an even value and also at all the position, we have an odd value. 63 00:05:43,720 --> 00:05:51,190 OK, so that's basically what we have for this example example, number two will have like return one 64 00:05:51,580 --> 00:05:56,470 and for the first example, we will have to return zero. 65 00:05:57,640 --> 00:06:00,090 OK, so that's the exercise. 66 00:06:00,130 --> 00:06:02,410 Not so easy, not so trivial. 67 00:06:02,560 --> 00:06:10,900 You have somehow to distinguish between many different options and many different possible numbers that 68 00:06:10,900 --> 00:06:19,150 you have to take care of and how basically you find this position using some recursive approach, although 69 00:06:19,150 --> 00:06:25,660 the the Terentiev approach using sound for a while loop, many seem a little bit easier to solve this 70 00:06:25,660 --> 00:06:29,630 exercise, but that's not what we are here for. 71 00:06:29,640 --> 00:06:38,080 Basically, we are here to solve it on using the recursive approach, the recursive concept and using 72 00:06:38,080 --> 00:06:41,590 this recursive recursion function. 73 00:06:41,670 --> 00:06:46,750 OK, so think about it, how you can solve it even even. 74 00:06:46,750 --> 00:06:47,410 I don't know. 75 00:06:47,420 --> 00:06:51,040 Let's try even to take a few hours. 76 00:06:51,280 --> 00:06:59,140 If you still don't get like the perfect result that works for all of the numbers you are trying for 77 00:06:59,140 --> 00:07:01,760 all of the natural numbers you were trying either. 78 00:07:01,840 --> 00:07:07,030 These numbers are going to be one digit, two digits, three digits, five digits and so on and so forth. 79 00:07:07,510 --> 00:07:09,310 OK, so take some time. 80 00:07:09,400 --> 00:07:12,700 Think about it, even if you can solve it in a few hours. 81 00:07:13,120 --> 00:07:15,610 Don't leave this exercise. 82 00:07:15,610 --> 00:07:18,040 Don't jump straight to the solution. 83 00:07:18,340 --> 00:07:19,960 Try to solve it on your own. 84 00:07:20,020 --> 00:07:26,920 It's very important that it's not a trivial that's not an easy exercise and it's mandatory for you to 85 00:07:26,920 --> 00:07:34,060 give it a shot on your own and to try to become a better programmer, because that's the process and 86 00:07:34,060 --> 00:07:36,970 that's the way guys who. 87 00:07:37,270 --> 00:07:39,630 So I hope everything is clear to you. 88 00:07:40,600 --> 00:07:48,250 Let me know if you have any questions about this exercise and hopefully you will manage to solve it 89 00:07:48,250 --> 00:07:52,060 on your own and then to compare it with my solutions. 90 00:07:52,180 --> 00:07:53,650 If not, of course. 91 00:07:54,540 --> 00:08:02,370 Please, after that, take the solutions video and make sure that everything is clear to you and that 92 00:08:02,370 --> 00:08:05,940 you are capable of proceeding further. 93 00:08:06,570 --> 00:08:08,460 So thank you guys for watching. 94 00:08:08,490 --> 00:08:13,170 My name is what this is Alphatech and we are going to solve it together. 95 00:08:13,170 --> 00:08:14,400 So let's go. 9204

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