Write a basic algorithm to find the second largest number in an unsorted array. Implement def second_largest(nums): and return the second distinct largest integer. The input contains at least two distinct values, and the result must be found without sorting the array.
def second_largest(nums):