Update array-3rd-distinct-0n.py

This commit is contained in:
bt3gl 2023-07-30 12:34:01 -07:00 committed by GitHub
parent 6dc689f3a0
commit 0ed8794fda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ Do it O(n).
import math
def thirdMax(nums: list[int]) -> int:
def third_max(nums: list[int]) -> int:
first_max = -math.inf
second_max = -math.inf
@ -38,4 +38,4 @@ def thirdMax(nums: list[int]) -> int:
if __name__ == "__main__":
nums = [3,2,1]
assert(thirdMax(nums) == 1)
assert(third_max(nums) == 1)