mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-30 04:36:08 -04:00
Update array-3rd-distinct-0n.py
This commit is contained in:
parent
6dc689f3a0
commit
0ed8794fda
@ -9,7 +9,7 @@ Do it O(n).
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
|
|
||||||
def thirdMax(nums: list[int]) -> int:
|
def third_max(nums: list[int]) -> int:
|
||||||
|
|
||||||
first_max = -math.inf
|
first_max = -math.inf
|
||||||
second_max = -math.inf
|
second_max = -math.inf
|
||||||
@ -38,4 +38,4 @@ def thirdMax(nums: list[int]) -> int:
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
nums = [3,2,1]
|
nums = [3,2,1]
|
||||||
assert(thirdMax(nums) == 1)
|
assert(third_max(nums) == 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user