Python Solution - 90% Speed - O(n) Time, O(1) Space Complexity
Python Solution - 90% Speed - O(n) Time, O(1) Space Complexity\n\nThe code below tracks two variables (a,b) representing the two highest values found in the arr
**Python Solution - 90% Speed - O(n) Time, O(1) Space Complexity**\n\nThe code below tracks two variables (a,b) representing the two highest values found in the array. After one linear pass, we can use these values to return the answer.\nCheers,\n```\nclass Solution:\n    def maxProduct(self, nums):\n        a = b = float(\'-inf\')\n        for x in nums:\n            if x>a:\n                a, b = x, a\n            elif x>b:\n                b = x\n        return (a-1)*(b-1)\n```
['Python', 'Python3']