Easy C // C++ // Java Solution Beats 100%
Intuition\n\nJava []\nclass Solution {\n    public String triangleType(int[] nums) {\n        int a = nums[0];\n        int b = nums[1];\n        int c = nums[2
# Intuition\n![Screenshot 2024-02-10 185844.png](https://assets.leetcode.com/users/images/c5c8e6ba-69c7-4b33-ab52-2310916d9725_1707571782.3515818.png)\n```Java []\nclass Solution {\n    public String triangleType(int[] nums) {\n        int a = nums[0];\n        int b = nums[1];\n        int c = nums[2];\n\n        if (a == b && b == c)\n            return "equilateral";\n        if ((a == b && a + b > c) || (b == c && b + c > a) || (a == c && a + c > b))\n            return "isosceles";\n        if (a + b > c && b + c > a && a + c > b)\n            return "scalene";\n\n        return "none";\n    }\n}\n```\n```C++ []\nclass Solution {\npublic:\n    string triangleType(vector<int>& nums) {\n        sort(nums.begin(), nums.end());\n        if (nums[2] >= nums[0] + nums[1])\n            return "none";\n        \n        return nums[0] == nums[2] ? "equilateral": nums[0] == nums[1] || nums[1] == nums[2] ? "isosceles" : "scalene";\n    }\n};\n```\n```C []\nchar* triangleType(int* nums, int numsSize) {\n    int a = nums[0];\n    int b = nums[1];\n    int c = nums[2];\n\n    if (a == b && b == c)\n        return "equilateral";\n    if ((a == b && a + b > c) || (b == c && b + c > a) || (a == c && a + c > b))\n        return "isosceles";\n    if (a + b > c && b + c > a && a + c > b)\n        return "scalene";\n\n    return "none";\n}\n```\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n# Code\n```\nclass Solution {\n    public String triangleType(int[] nums) {\n        int a = nums[0];\n        int b = nums[1];\n        int c = nums[2];\n\n        if (a == b && b == c)\n            return "equilateral";\n        if ((a == b && a + b > c) || (b == c && b + c > a) || (a == c && a + c > b))\n            return "isosceles";\n        if (a + b > c && b + c > a && a + c > b)\n            return "scalene";\n\n        return "none";\n    }\n}\n```\n# Please upvote if it\'s helpful...
['C', 'C++', 'Java']