Swap Values

You can do something like this.

swap(nums[mid], nums[l];