Write a program to find the maximum and second maximum numbers in an integer array without sorting the array.
Implement def find_max_and_second_max(nums):. Return a two-element list containing the maximum value followed by the second-largest distinct value. Assume the array contains at least two distinct integers.
def find_max_and_second_max(nums):