to accesss the vetor last element can we use v.end( )-1
Vector last element access
@YASHMATHURIA123 here refer this
https://www.geeksforgeeks.org/last-element-of-vector-in-cpp-accessing-and-updating/ (ways)
And yes your way is correct to like this
auto it=v.end()-1;
cout<<*it<<endl;
dont forget to hit like and mark resolved if cleared