Practice Type of Triangle
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Use the three lengths in nums as triangle sides. Return "none" if they cannot form a nondegenerate triangle; otherwise return "equilateral" when all three match, "isosceles" when exactly two match, or "scalene" when all differ.
Source: Type of Triangle on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums = [3,3,3]
Output
"equilateral"
# Example 2
Input
nums = [3,4,5]
Output
"scalene"
Constraints
nums.length == 3
1 <= nums[i] <= 100
Related LeetCode Problems
Practice more problems similar to Type of Triangle.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.