Return the second largest different value in nums. Equal values count once, so in [7, 7, 5] the second largest is 5. If there are fewer than two different values, return -1.
Example 1
Input:
second_largest([4, 9, 9, 6])
Output:
6
The largest is 9, the second largest different value is 6.
Example 2
Input:
second_largest([5, 5, 5])
Output:
-1
Only one different value, so the answer is -1.
0 <= len(nums) <= 3 * 10**50 <= nums[i] <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.