firstMax
, secondMax
, and thirdMax
to None
.firstMax
or firstMax
is None
, shift the maxes and set firstMax
to the current number.secondMax
or secondMax
is None
, shift the maxes and set secondMax
to the current number.thirdMax
or thirdMax
is None
, set thirdMax
to the current number.thirdMax
is not None
, return it as the third distinct maximum.thirdMax
is None
, return firstMax
as the maximum number.