You are viewing a single comment's thread. Return to all comments →
Python best solution If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions
#Time complexity: O(n*log(n)) #Space complexity (ignoring input): O(1) sticks.sort(reverse=True) for index in range(0, len(sticks) - 2): if sticks[index] < sticks[index + 1] + sticks[index + 2]: triangle = [sticks[index], sticks[index + 1], sticks[index + 2]] triangle.sort() return triangle 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 best solution
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions