Find the second largest number in the given array.
Return the second largest distinct value. If the array contains fewer than two distinct values, return None. Implement second_largest(nums), where nums is a list of integers and the result is an integer or None.
def second_largest(nums):