Created
April 2, 2022 09:32
-
-
Save mdpabel/f68980ae40152281577f8524e48af568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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