I want to understand the last part of this video

this one!

for(int i=0;i<n;i++)
{
largest = max(largest, arr[i]);
smallest = min(smallest, arr[i]);
}

@deepanshuchoudhary
max(largest, arr[i]); max returns maximum of the two arguments provided, so this will return the max from largest and arr[i], ie the current element. This answer is assigned to largest. While iterating through all the elements of the array, you are assiging the larger element to largest, eventually you will end up with the largest element from the whole array.
Similarly, the min() function will return the smaller element.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.