414、第三大的数
class Solution {public int thirdMax(int[] nums) {Arrays.sort(nums);int temp=nums[0];int ans=nums[0];int count = 0;// if(nums.length<3){// return nums[nums.length-1];// }// else {for(int i=nums.length-1;i>0;i--){if (nums[i]>nums[i-1]){if(count>=2) break;count++;temp=nums[i-1];}}// }if(count>=2) ans=temp;else ans=nums[nums.length-1];return ans;}}