Third Maximum Number
Given integer array nums
, return the third maximum number in this array. If the third maximum does not exist, return the maximum number.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 104
231 <= nums[i] <= 231 - 1
Follow up: Can you find an O(n)
solution?
Solutions
🧠 Cpp
Last updated