Didnt understood this ques

Study the following code snippet:

vector< int > data = {100, 142, 138, 96, 32, 149};
swap(data[2], data[5]);
int val1 = *max_element(data.begin(), data.begin() +3);
int val2 = *max_element(data.begin()+3,data.end());
cout<< min(val1, val2);
Will the above code compile? If yes then what is the output?

answer will be 138
check this

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.