Problem
Submissions

Problem: Third Maximum Number

Statement

For a given integer array nums, your task is to return the third maximum distinct number in the array. If there are fewer than three distinct numbers, return the maximum number.

Constraints:

  • 1<=1 <= nums.length <=103<= 10^3

  • −231<=-2^{31} <=nums[i]<=231−1<= 2^{31}-1

Problem
Submissions

Problem: Third Maximum Number

Statement

For a given integer array nums, your task is to return the third maximum distinct number in the array. If there are fewer than three distinct numbers, return the maximum number.

Constraints:

  • 1<=1 <= nums.length <=103<= 10^3

  • −231<=-2^{31} <=nums[i]<=231−1<= 2^{31}-1