I expected the following program will give 0 as output but actually it is 1. Why the first element is considered and last element is not considered for min calculation?
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> arr = {5,4,3,2,1,0};
cout<<*min_element(arr.begin()+1,arr.begin()+5);
return 0;
}