送分题
class Solution(object):
def largestPerimeter(self, A):
"""
:type A: List[int]
:rtype: int
"""
A = sorted(A, reverse=True)
if len(A) < 3:
return 0
i = 0
while i < len(A) - 2:
if A[i] < A[i + 1] + A[i + 2]:
return A[i] + A[i + 1] + A[i + 2]
else:
i+=1
return 0