class Solution:
    def maxProduct(self, nums: List[int]) -> int:
        # O(N) O(1)
        fst,snd = -1,-1
        for x in nums:
            if fst <= x: # for fst and snd is same 
                snd = fst if fst != -1 else snd  # can ignore but somehow will optimize 
                fst = x
            elif x > snd: # incase fst get the max number in the beginning 
                snd = x  
        #print(fst,snd)
        return (fst-1)*(snd-1)