β back to unit
Easy
# sorting easy
Biggest to the Back
The heaviest pumpkin rides at the back of the wagon so it doesn't squash the others. π
You get a list of nums (at least one). Swap the biggest value to the LAST position and print the list, comma-separated. (If there's a tie, move the first biggest.)
Example:
Input: nums = [4, 9, 2, 5]
Output: 4,5,2,9
The biggest value is 9, sitting at index 1 β swap it with the last position (index 3), giving [4, 5, 2, 9].
π‘ need a hint?
sort-biggest-back.pyπ given lines are locked β write your code in between
loading...