You are given an array of integers, return the 4th maximum number in this array.
If it does not exist, return the maximum number.
The time complexity must be in O(n).
输入描述:
Only 1 test case for each Input. Every test case is an non-empty array separated by " ".
输出描述:
Output the fourth maximum number of the array.
示例1
说明
The 4th maximum number is 1.
示例2
说明
The 4th maximum number does not exist, so return the maximum number 3.
示例3
说明
Note that the 4th maximum here means the 4th maximum distinct number.
Both numbers with value 2 are both considered as 3rd maximum.