Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hmong
Icelandic
Igbo
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Portuguese (Portugal)
Punjabi
Quechua
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.