We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Try drawing a triangle with sides 1, 2 and 4 on paper, you won't succeed. That's because, for forming any triangle, sum of two sides should be greater than the third side, which isn't the case here.
Cookie support is required to access HackerRank
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 →
No buddy, output should be 1 2 2 and not 1 2 4.
Try drawing a triangle with sides 1, 2 and 4 on paper, you won't succeed. That's because, for forming any triangle, sum of two sides should be greater than the third side, which isn't the case here.