diff --git a/easy/type_of_triangle.py b/easy/type_of_triangle.py new file mode 100644 index 0000000..6805c9b --- /dev/null +++ b/easy/type_of_triangle.py @@ -0,0 +1,16 @@ +# https://leetcode.com/problems/type-of-triangle + +from typing import List + +class Solution: + def triangleType(self, nums: List[int]) -> str: + [a, b, c] = nums + if a == b == c: + return "equilateral" + s = a + b + c + m = max(nums) + if s - m <= m: + return "none" + if a == b or b == c or a == c: + return "isosceles" + return "scalene" \ No newline at end of file