We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de5edb5 commit dd21ca3Copy full SHA for dd21ca3
C++/maximum-containers-on-a-ship.cpp
@@ -0,0 +1,10 @@
1
+// Time: O(1)
2
+// Space: O(1)
3
+
4
+// math
5
+class Solution {
6
+public:
7
+ int maxContainers(int n, int w, int maxWeight) {
8
+ return min(maxWeight / w, n * n);
9
+ }
10
+};
0 commit comments