 What's up guys, my name is Michael and welcome to my YouTube chat today. We're gonna do height checker so students are placed in a line and an Increasing order of heights for an annual photo return the minimum number of students not standing in the right position Okay, so this is actually very very very easy Okay, this is actually a very dumb question They just they're just trying to confuse you. Okay With all this non decreasing order. This is just increasing. Okay. This is just means increasing order So how do you do this? I'll tell you how to do this First we create a new vector And we're gonna call this a copy and what are we gonna do? We're gonna point it to heights so now The vector copy is a separate copy of heights because this actually caused a copy constructor and it copies all The values into a new vector called a copy. Okay, so now we have a separate array vector of Heights now what are we gonna do? We're going to sort it We're gonna sort copy From the beginning to the end Okay, and what does that do all my bad? What does that do that basically just says okay now? I'm it's gonna be in increasing order now because it's sorted Now we want to return the number minimum number of students not standing in the right positions, so we need a counter Number wrong positions and we set that to zero Okay, and we are going to return wrong positions in the end So what does it mean by number of students not saying the right positions? Well, we're gonna go through both of our arrays and if Heights at I is not equal to So if each height is not equal to the sorted height Then it's in the wrong position. So we increase wrong positions Positions positions plus plus After we sort it After we increase it. We just return it. So if you guys understand what I'm doing is that I'm just counting the the number of Wrong positions that is not sorted based on the heights that is not sort in the right order So that's essentially how you do this question This is a dumb question because they just try to confuse you which is what they probably do in a lot of these interviews But if you understand how to do it It would be very very good Anyway, ready come subscribe. I'll check you guys later. Peace