Skip to content

Commit be14ed0

Browse files
authored
Create maximum-containers-on-a-ship.py
1 parent dd21ca3 commit be14ed0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Time: O(1)
2+
# Space: O(1)
3+
4+
# math
5+
class Solution(object):
6+
def maxContainers(self, n, w, maxWeight):
7+
"""
8+
:type n: int
9+
:type w: int
10+
:type maxWeight: int
11+
:rtype: int
12+
"""
13+
return min(maxWeight//w, n*n)

0 commit comments

Comments
 (0)