Given three positive integers a, b, and c representing side lengths, classify the triangle they form.
Return:
"equilateral" if all three sides are equal"isosceles" if exactly two sides are equal"scalene" if all three sides are different"invalid" if the sides cannot form a valid triangleA triangle is invalid if any side is greater than or equal to the sum of the other two (triangle inequality theorem).
a = 3, b = 3, c = 3"equilateral"a = 3, b = 3, c = 5"isosceles"a = 3, b = 4, c = 5"scalene"a = 1, b = 2, c = 3"invalid"1 <= a, b, c <= 10^6a, b, and c are positive integers.Run your code to see results
Use Cmd+Enter to run