| about | help | code help+videos | done | prefs |
min_to_front
Write a function min_to_front that takes a list of integers as a parameter and that moves the minimum value in the list to the front, otherwise preserving the order of the elements. For example, if a variable called list stores the following values: [3, 8, 92, 4, 2, 17, 9] and you make the call of min_to_front(list) it should store the following values after the call: [2, 3, 8, 92, 4, 17, 9] You may assume that the list stores at least one value. min_to_front([3, 8, 92, 4, 2, 17, 9]) → [2, 3, 8, 92, 4, 17, 9] min_to_front([6, 1, 4, -2]) → [-2, 6, 1, 4] min_to_front([50, 10, 30, 40, 20]) → [10, 50, 30, 40, 20] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290 Post-solution available
Copyright Nick Parlante 2017 - privacy