How would you find the second largest number in an unsorted array without using built-in sort functions?
Implement the function below to return the second distinct largest integer. The input contains at least two distinct values, and the result must be found without sorting or other built-in ordering functions.
Input: An array of integers.
Output: The second distinct largest integer.
def second_largest(nums):