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