Wrong output for the activity selection problem

What is wrong with my code for the activity selection problem? It is not passing one test case.
Code link
https://www.codepile.net/pile/X8XwE1Mm

@sasanand786
hello shashwat,
declare ur arr vector inside first while loop

bro then sort function will not work

as arr is out of scope

@sasanand786
check ur code i have made some modifications

thanks bro it got resolved.