You are viewing a single comment's thread. Return to all comments →
def maximumPerimeterTriangle(sticks): n = len(sticks) sticks.sort(reverse=True) for i in range(n - 2): a, b, c = sticks[i], sticks[i + 1], sticks[i + 2] if a < b + c: return [c, b, a] return [-1]
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 →