JAVA || Beginner Friendly || Easy to Understand || IF-ELSE Approach
ApproachCheck if the Given Sides Form a Valid Triangle (isTri function):

A valid triangle must satisfy the Triangle Inequality Theorem, which states that the s

# Approach
Check if the Given Sides Form a Valid Triangle (isTri function):

- A valid triangle must satisfy the Triangle Inequality Theorem, which states that the sum of the lengths of any two sides must be greater than the length of the third side.

- The method isTri(int[] arr) verifies this condition by checking:
𝑎 + 𝑏 > 𝑐, 𝑏 + 𝑐 > 𝑎, and 𝑎 + 𝑐 > 𝑏
- If all these conditions hold, the method returns true; otherwise, it returns false, meaning the given sides do not form a valid triangle.

Determine the Triangle Type (triangleType function):

- If isTri(nums) returns false, it means the given sides cannot form a triangle, and the function returns "none".

- If it is a valid triangle, the function classifies it into one of three categories:

- Equilateral: All three sides are equal. (nums[0] == nums[1] == nums[2])

- Isosceles: Exactly two sides are equal. (nums[0] == nums[1] OR nums[1] == nums[2] OR nums[0] == nums[2])

- Scalene: All sides have different lengths.


# Complexity
- Time complexity: $$ O(1)$$
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: $$ O(1)$$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public String triangleType(int[] nums) {
        if(!isTri(nums)){
            return "none";
        }
        else{
            if(nums[0]==nums[1] && nums[1]==nums[2]){
                return "equilateral";
            }
            else if((nums[0]==nums[1]) || (nums[1]==nums[2]) ||(nums[0]==nums[2])){
                return "isosceles";
            }
            else{
                return "scalene";
            }
        }
    }

    public boolean isTri(int[] arr){
        int side1=arr[0]+arr[1];
        int side2=arr[1]+arr[2];
        int side3=arr[0]+arr[2];

        if((side1>arr[2]) && (side2>arr[0]) && (side3>arr[1])){
            return true;
        }
        else{
            return false;
        }
    }
}
```
['Array', 'Math', 'Sorting', 'Java']