From 40b3ed526954c072fad11b020abc7d548e3eb8f2 Mon Sep 17 00:00:00 2001 From: rimogsu Date: Wed, 9 Sep 2026 10:49:44 +0900 Subject: [PATCH] 2525 --- .... Categorize Box According to Criteria.py" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "leetcode3/\353\263\200\354\247\200\355\230\221/v3/2525. Categorize Box According to Criteria.py" diff --git "a/leetcode3/\353\263\200\354\247\200\355\230\221/v3/2525. Categorize Box According to Criteria.py" "b/leetcode3/\353\263\200\354\247\200\355\230\221/v3/2525. Categorize Box According to Criteria.py" new file mode 100644 index 00000000..e95288ca --- /dev/null +++ "b/leetcode3/\353\263\200\354\247\200\355\230\221/v3/2525. Categorize Box According to Criteria.py" @@ -0,0 +1,29 @@ + +''' +1. 아이디어 : +문제에 나온 조건에 맞게 분류한다. + +2. 시간복잡도 : +o(1) + +3. 자료구조/알고리즘 : +''' + +class Solution: + def categorizeBox(self, length: int, width: int, height: int, mass: int) -> str: + volume = length * width * height + + heavy = True if mass >= 100 else False + bulky = False + + if length >= 10 ** 4 or width >= 10 ** 4 or height >= 10 ** 4 or volume >= 10 ** 9: + bulky = True + + if heavy and bulky: + return 'Both' + elif not heavy and not bulky: + return "Neither" + elif bulky and not heavy: + return "Bulky" + else: + return "Heavy" \ No newline at end of file