You are viewing a single comment's thread. Return to all comments →
Python 3 solution:
import typing def maximumPerimeterTriangle( sticks: list[int], ) -> tuple[int, int, int] | tuple[typing.Literal[-1]]: sticks.sort(reverse=True) for i in range(len(sticks) - 2): a, b, c = sticks[i : i + 3] 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 →
Python 3 solution: