✅Beats 100.00% of users || Best Method🔥 || C# || Easy Explanation || Beginner Friendly🔥🔥🔥
Intuition\n- Problem: Determine the type of triangle that can be formed from three given side lengths.\n- Approach: Sort the lengths, check triangle inequality 
# Intuition\n- **Problem**: Determine the type of triangle that can be formed from three given side lengths.\n- **Approach**: Sort the lengths, check triangle inequality and side equality conditions to classify the triangle.\n\n![Untitled.png](https://assets.leetcode.com/users/images/d76be5f5-025a-46b0-ad15-cd33cd9baf5a_1707046732.5572546.png)\n\n\n# Approach\n- Sort the lengths: Ensure smallest to largest order for easier comparisons.\n- Check triangle inequality: If the sum of the two shortest sides is less than or equal to the longest side, no triangle can be formed ("**none**").\n- Check for equilateral: If all three sides are equal, it\'s an equilateral triangle ("**equilateral**").\n- Check for isosceles: If any two sides are equal, it\'s an isosceles triangle ("**isosceles**").\n- Otherwise, it\'s a scalene triangle: All sides have different lengths ("**scalene**").\n\n# Complexity\n- Time complexity:\n    - O(N log N), dominated by the sorting algorithm (Array.Sort()).\n    - The remaining comparisons and logic take constant time.\n\n- Space complexity:\n    - O(1), constant space.\n\n# Code\n```\npublic class Solution {\n    public string TriangleType(int[] nums) {\n        \n        Array.Sort(nums);\n        \n        if( nums[0] + nums[1] <= nums[2]) return "none";\n        else if(nums[0] == nums[1] && nums[0] == nums[2]) return "equilateral";\n        else if(nums[0] == nums[1] || nums[1] == nums[2]) return "isosceles";\n        else return "scalene";\n    }\n}\n```
['Sorting', 'C#']