标签:imu int amp href div count ber des list
public class Solution { public int ThirdMax(int[] nums) { var third = 0; var list = nums.Distinct().OrderByDescending(x => x).ToList(); if (list.Count == 0) { third = 0; } else if (list.Count >= 1 && list.Count <= 2) { third = list[0]; } else { third = list[2]; } return third; } }
https://leetcode.com/problems/third-maximum-number/#/description
标签:imu int amp href div count ber des list
原文地址:http://www.cnblogs.com/asenyang/p/6770026.html