You are given an array of integers. Write a function to find the second largest number in the array.
Use the second distinct largest value. Return None when the array contains fewer than two distinct values.
Function: def second_largest(nums):
Input: A non-empty list of integers.
Output: The second distinct largest integer, or None if it does not exist.
def second_largest(nums):