All right.
So it's time for you to start writing some a race on your own and this problem set.
I have a few challenges that cover arrays Array methods and array iteration.
I'm going to introduce all the problems in this video first and then in the next video I'll go over
the solutions as always the point here is that you attempt these on your own for these you are going
to be writing code.
I would do them in one giant file but it's up to you how you actually structure that.
The first one is print reverse.
So print reverse is a function that you'll need to write.
That takes a single argument and that argument is assumed to be an array and all that the function needs
to do is print that array one line at a time in reverse order so you can see printed reverse of the
array ABC prints out.
C B A.
So that your hint here you need to use a loop.
You can see here and the examples is uniform when we pass in an array of all one's returns true.
But when we pass in an array it has a single two in it.
Things are no longer identical.
So we return false.
Same thing here.
This array is three letter B's.
So those are identical or uniform.
So we return true.
In this case they're not the same Muhtar.
So it returns false.
Your head here is that you'll want to use a loop and more importantly you want to have a variable that
just keeps track of the very first item in the index and then you'll compare that in the loop to the
next item.
And then if that are equal to compared to the next one into the next one and if at any point they're
not equal then you're just done return false.
Next up is some array some array is a function that should take an array and it's going to be assumed
that the array is full of numbers.
All you need to do is add the numbers up and return the sum.
You can see here some array of one to three is equal to one plus two plus three which returns six.
You're hinting is that you need to use a loop and pretty much all this you need a loop.
And also you want to have a variable called result or answer or some where you're going to store the
answer and constantly add into it each time through the loop.
The last problem in the set is Max.
So Max is a function that should also accept an array and you can assume the arrays all numbers and
all that it needs to do is return the maximum number in that array.
So as you can see here when we give it one two and three in a single array we get three returned because
that's the maximum of that array.
Likewise when we do it here 10 3 10 and 4 we return 10 because it's a maximum in that array.
So the hint again no need to use a loop and you'll need to use a variable that's going to be storing
your maximum number and every time through the loop you'll need to update that variable.
If the current number in the loop is greater than the old maximum.
All right so that's it for this problem set.
I strongly encourage that you take the time to do these they're picked.
They're designed at a very particular way.
They're going to help you a lot if you just stop and spend half an hour or an hour attempting these
problems in the next video.
I'm going to go over the solutions as always starting from scratch.