Skip to content

3024. Type of Triangle #1701

Answered by mah-shamim
mah-shamim asked this question in Q&A
May 19, 2025 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

We need to determine the type of triangle that can be formed with three given side lengths. The possible types are equilateral, isosceles, scalene, or none if the sides cannot form a valid triangle.

Approach

  1. Check Validity of Triangle: For three sides to form a valid triangle, the sum of the lengths of any two sides must be greater than the length of the third side. Sorting the sides simplifies this check because we only need to ensure that the sum of the two smaller sides is greater than the largest side.
  2. Determine Triangle Type: After confirming the sides form a valid triangle, we check the equality of the sides:
    • Equilateral: All three sides are equal.
    • Isosceles: Exactly two sides are…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@basharul-siddike
Comment options

@mah-shamim
Comment options

mah-shamim May 19, 2025
Maintainer Author

Answer selected by basharul-siddike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested easy Difficulty
2 participants