Add easy/type_of_triangle.py

This commit is contained in:
bumpsoo 2025-05-19 22:15:24 +09:00
parent 1c6922e62d
commit d5429e9e22

16
easy/type_of_triangle.py Normal file
View file

@ -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"