Skip to content

Instantly share code, notes, and snippets.

@mdpabel
Created April 2, 2022 09:32
Show Gist options
  • Save mdpabel/f68980ae40152281577f8524e48af568 to your computer and use it in GitHub Desktop.
Save mdpabel/f68980ae40152281577f8524e48af568 to your computer and use it in GitHub Desktop.
class Solution:
"""
6,5,3,0-2-3
"""
def maxp3(self, A):
A.sort(reverse=True)
n = len(A)
return max(A[0] * A[1] * A[2], A[n-1] * A[n-2]* A[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment