Find the minimum and maximum values in an array of numbers.
Implement find_min_max(nums) for a non-empty list of integers. Return a two-element list containing the minimum value followed by the maximum value. Aim for one pass through the array and constant auxiliary space.
Function: def find_min_max(nums):
Input: A non-empty list of integers. Output: [minimum_value, maximum_value].
def find_min_max(nums):