Pancake sorting algorithm

it is giving compilation error

In flip it should be reverse(v.begin(),v.begin()+k);
also I think testcases include such arrays which are not permutation(against given constraints), so also think how to handle such cases.

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.