Maximum Perimeter Triangle

  • + 0 comments

    You don't NEED to, but it makes the comparisons more efficient since you already know at every step in your logic which is the longest leg of the triangle and which is the shortest. Also, the longest triangle will probably be made up of the longest sticks, so by sorting you are getting to the longest sticks most efficiently.