Simple Easy to Understand Java Code
Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n\nclass Solution {\n    public String triangleType(int[] nums) {\n        if(nums[0] ==
# Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n```\nclass Solution {\n    public String triangleType(int[] nums) {\n        if(nums[0] == nums[1] && nums[1] == nums[2]){\n            return "equilateral";\n        }\n        if(nums[0] + nums[1] <= nums[2] || nums[1] + nums[2] <= nums[0] || nums[0] + nums[2] <= nums[1]){\n            return "none";\n        }\n        if(nums[0] == nums[1] || nums[1] == nums[2] || nums[0] == nums[2]){\n            return "isosceles";\n        }\n        return "scalene";\n    }\n}\n```
['Java']