void sort(vector<int> &nums, int l, int r)
{
if(l >= r)
return;
int low = l;
int height = r;
int keyVal = nums[low];
while (low<height)
{
while (low < height&&nums[height] >= keyVal)
height--;
nums[low] = nums[height];
while (low < height&&nums[low] <= keyVal)
low++;
nums[height] = nums[low];
}
nums[low] = keyVal;
sort(nums,l,low-1);
sort(nums,low+1,r);
}