Skip to content

Commit 40b3ed5

Browse files
committed
2525
1 parent 759e09b commit 40b3ed5

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
'''
3+
1. 아이디어 :
4+
문제에 나온 조건에 맞게 분류한다.
5+
6+
2. 시간복잡도 :
7+
o(1)
8+
9+
3. 자료구조/알고리즘 :
10+
'''
11+
12+
class Solution:
13+
def categorizeBox(self, length: int, width: int, height: int, mass: int) -> str:
14+
volume = length * width * height
15+
16+
heavy = True if mass >= 100 else False
17+
bulky = False
18+
19+
if length >= 10 ** 4 or width >= 10 ** 4 or height >= 10 ** 4 or volume >= 10 ** 9:
20+
bulky = True
21+
22+
if heavy and bulky:
23+
return 'Both'
24+
elif not heavy and not bulky:
25+
return "Neither"
26+
elif bulky and not heavy:
27+
return "Bulky"
28+
else:
29+
return "Heavy"

0 commit comments

Comments
 (0)