You are viewing a single comment's thread. Return to all comments →
def maximumPerimeterTriangle(sticks): sticks.sort() b=sticks[0]+sticks[1] a=[0,0,0] for i in range(2,n): if b>sticks[i]: a=[sticks[i-2],sticks[i-1],sticks[i]] b=b-sticks[i-2]+sticks[i] if a[0]==a[1]==a[2]==0: return ['-1'] else: return a
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Perimeter Triangle
You are viewing a single comment's thread. Return to all comments →