0 out of 464 challenges solved
Write a function `pancake_sort(nums)` that takes a list of integers `nums` and sorts it in ascending order using the pancake sorting algorithm. Pancake sorting involves repeatedly flipping the prefix of the list to move the largest unsorted element to its correct position. #### Example Usage ```python [main.nopy] print(pancake_sort([15, 79, 25, 38, 69])) # Output: [15, 25, 38, 69, 79] print(pancake_sort([98, 12, 54, 36, 85])) # Output: [12, 36, 54, 85, 98] print(pancake_sort([41, 42, 32, 12, 23])) # Output: [12, 23, 32, 41, 42] ```
def pancake_sort(nums): """ Sorts a list of integers using the pancake sorting algorithm. Args: nums (list): A list of integers to be sorted. Returns: list: A sorted list of integers in ascending order. """ # Placeholder for the solution pass