Easy Java / C++ Solution (😍100% Beats Runtime in Java) 😎😎 -> 😮😮
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1. For "equilateral" tr
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. For `"equilateral"` triangle all size of triangle is same so **num[0]==nums[1]==nums[2]** is the condition for that.\n2. For `"isosceles"` triangle any two side of the triangle would be same and triangle\'s any two side\'s sum is always greater then remaining third side is the condition for it.\n3. For `"scalene"` triangle only condition is that triangle\'s any two side\'s sum is always greater then remaining third side.\n4. If none of the above condition is true then the given three side doesn\'t make triangle so in that case return `"none"`.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code for Java\n```\nclass Solution {\n    public String triangleType(int[] nums) {\n        \n        if(nums[0]==nums[1] && nums[1]==nums[2])\n        return ("equilateral");\n\n        else if(\n            (nums[0]==nums[1] || nums[0]==nums[2] || nums[1]==nums[2])\n                && nums[0]+nums[1]>nums[2] && nums[0]+nums[2]>nums[1]\n                && nums[2]+nums[1]>nums[0])\n        return ("isosceles");\n\n        else if(nums[0]+nums[1]>nums[2] && nums[0]+nums[2]>nums[1]\n                && nums[2]+nums[1]>nums[0])\n        return ("scalene");\n\n        else\n        return ("none");\n    }\n}\n```\n\n# Code for C++\n```\nclass Solution {\npublic:\n    string triangleType(vector<int>& nums) {\n        \n        if(nums[0]==nums[1] && nums[1]==nums[2])\n        return ("equilateral");\n\n        else if(\n            (nums[0]==nums[1] || nums[0]==nums[2] || nums[1]==nums[2])\n                && nums[0]+nums[1]>nums[2] && nums[0]+nums[2]>nums[1]\n                && nums[2]+nums[1]>nums[0])\n        return ("isosceles");\n\n        else if(nums[0]+nums[1]>nums[2] && nums[0]+nums[2]>nums[1]\n                && nums[2]+nums[1]>nums[0])\n        return ("scalene");\n\n        else\n        return ("none");\n    }\n};\n```\n
['Array', 'C++', 'Java']