sticks. A child wants to build a triangle using each stick as one side.
Decide what comes out:
- "equilateral": all three sides are equal;
- "isosceles": exactly two sides are equal;
- "scalene": all sides have different lengths;
- "none": no triangle can be built (two sides together are not longer than the third).
Return one of these strings.sticks=[7, 7, 7] → 'equilateral'
All three sticks are equal, so the triangle is equilateral.
sticks=[5, 9, 5] → 'isosceles'
5 + 5 = 10 > 9, so a triangle exists, and exactly two sides match: isosceles.
sticks=[2, 3, 8] → 'none'
2 + 3 = 5 is not greater than 8: the short sticks cannot reach, so the answer is "none".
sticks=[7, 7, 7]
'equilateral'
Run checks the first 3 tests in your browser. Submit checks all 98 tests on the server, hidden ones included.