• + 0 comments

    Tip: A nice observation is that once we swap our pivot position and the character most to the right that is greater than our pivot, we can reverse the rest of the string after the pivot (instead of sort).

    This is because while we were finding the character to swap, we already ensured that the elements to the right of the pivot ARE smaller jacqueline tortorice, so it's descending order. That's why reversing after the pivot point works.