All language subtitles for 14. Continue (Upgrade) Rotate Left a given array by N positions - Solution

sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
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
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
hmn Hmong
is Icelandic
ig Igbo
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
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
pt-BR Portuguese (Brazil) Download
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
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
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
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

All right.

So have you come to some solution?

If so, please also feel free to share it with us, so we could take a look at it together.

But for now, let us solve it using this approach that I'm about to show you.

So first of all, what I want you to understand is, yeah, of course, we can separate all of them

into two functions into two separate functions.

But for now, since we are just practicing the programming and the general approach for algorithms,

some basic algorithms to rotate it to left by in positions, we are going to ask the following question

OK, I'm going to make it very, very straightforward, so we will not spend a lot of time on it.

So I want to ask you this one.

So we know that these part of code, we know that these aren't.

He's in charge of rotating by one, right?

Rotate by one position.

One was.

So what will happen if we apply rotate by one position to this array, so we know that after applying

these code, what we will get is the following three, four, seven, three and five.

Is this correct?

So this was to rotate by one.

And that's something that we have created in previous videos.

But that's not the expected result.

This is the expected to result, so from this to this, what we need to do is basically to take this

array once again.

And to apply on it, what should we apply in it?

Once again, the operation of rotate by one.

That's all that's all we need to do if we rotate this array by one again, so for will, go to there

in seven three five will be at the beginning and that should be the final result.

So we should use the main functionality here of rotating by one, rotate by one, rotate by one.

How many times and times is it clear?

So that's the main objective of what we want to do here and what do we want to achieve in solving this

exercise?

So let me show you how it will look in code.

So we said previously that these part of rotating by one position looks like this.

And now what we need to do is, let's say we defined an or you created a variable in and read it from

the user once again doesn't really matter.

But what is matter to us?

What does matter to us is every basically every time to apply these part of code.

OK?

That can again be used as an external function, but for now, for simplicity.

Let's leave it this way because we build our way up so we can use another for a loop.

OK?

Using some, I don't know, additional variable G.

OK, or better, I say let's use Kate will be better for understanding.

So for gay equals to zero as case less than what how many times we want to do all of this part of code,

we want to do it.

And times so gay equals to zero as long as gay is less than M K plus plus.

So these are part of code eight makes sure that we will use their reported left one element, one position

and times.

And basically, that's what will happen.

So we take the array once here we rotate it to the left.

That's what we get.

Then we go back to the outer loop.

We communicate by one.

We ask one is less than two.

Yes, so we make the rotation once again on this array.

And then we get this array and then we go, Kate plus one and we get to is to less than two.

The answer is no.

And we are done.

And now you should be able to print the array again and to see the expected results.

OK.

So, yeah, I hope this is clear, guys, and if you have any questions, feel free to ask.

Please run some tests on your own.

Make sure that everything works as expected because we do not have the exact full solutions.

We solve it together with you, at least in some of the exercises.

So, yeah, thank you so much for watching.

Leave me some reviews, some feedback.

It always helps and assists for me to know your thoughts and improving the content if it needs to be

improved.

But for now, thank you so much for watching again, and I'll see you in the next video.

My name is Ludd Lisas alpha tech.

My.

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