All language subtitles for 7. Challenge 1 - Solution

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

Okay, so if he is serious, we know how to how to work with it and how how these serious look like.

And just a quick reminder, we know that the first element F zero equals two, what, two zero and that

F one equals two one and then F two equals two one also.

Right.

The sum of the two previous values and the same goes for F three equals two, F two plus F one.

And this we can specify if one is A and F zero, which is a total of one, and they say is a total of

two and so on and so forth.

And we know that the formula for F there are the anth variable.

The arts are index in the Fibonacci serious.

We'll be equal to half of and minus one plus F, R and of minus two.

Okay.

So that's basically the mathematical explanation behind the serious.

And we want to write a function, a recursive function that will be able to receive this and this index

in these serious r n return of a value add this index.

So one of the ways to do so is to use, first of all, recursion.

OK.

We could solve it using iterations, but we will solve it using the recursions.

And the first thing that we are going to do is to create a function which will be of type end because

we are working with integers here and we will call this function a feedback on Nadji feeB on muchI,

if I'm not mistaken.

And here we are going to specify the index itself that these function will get.

So and specifies that the index and we are looking for the value in this particular index.

So how should we do it?

We know that if we take a look at these are formulated, we had an explanation of the challenge.

We can see that we have here, too.

There are two base cases and the first base cases.

If F if An equals to zero, then the value of this position also will be zero.

So the first condition will look like this.

If if an equals two zero two zero, then return zero.

That's it.

And also another base base case and stubborn condition will be if and if an equals two one, then return

one.

Right.

Because we can see that no mathematical operation is required here.

And from and you know, when N is greater than one, meaning it's two or higher.

Then we should use some formula to find out what will be its result.

And this recursive function, recursive call.

We know that these function, these people not she knows to find the value for these given index and

so feeble, feeble, she knows to find the value at a given index N.

And we know that by by looking at this formula.

This recursive formula, we can say that this function will return.

OK.

So feeble.

Not you for n feeble energy for n will return the feeble energy feeble energy for N minus one plus three

one.

Archie feeble.

Not cheap.

Four and minus two.

Is that clear so far.

We simply take the rules off from the mathematical explanation that we had in the challenge introduction.

We know that f f the Fibonacci value at Index M equals to the Fibonacci value at index N minus one plus

the Fibonacci value.

Add in an index and minus two.

And that's pretty much all that we've written here.

So Fibonacci for an Fibonacci Faran equals two.

Fibonacci four.

And minus one last.

Fibonacci of and minus two.

That's it.

And each of these recursive calls is going to call these function for N minus one and in minus two.

And it's going to be kind of a tree that will return value on every branch until it reaches out some

stopping condition where and equals to zero or M equals to one.

So I hope that's clear.

We are not going to write some main function in this video because it's pretty simple.

Just create some variable and call these function for whatever index you want and bring the result in.

Just open up Wikipedia or Google to compare and see that your printed result is as expected.

So I'll see you in the next challenge.

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