Skip to content

Commit beb5ed1

Browse files
committed
Runtime: 799 ms (Top 28.57%) | Memory: 86.3 MB (Top 42.86%)
1 parent c0a1c82 commit beb5ed1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/algorithms/M/Minimum Space Wasted From Packaging/Minimum Space Wasted From Packaging.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 799 ms (Top 28.57%) | Memory: 86.3 MB (Top 42.86%)
12
/**
23
* @param {number[]} packages
34
* @param {number[][]} boxes
@@ -9,7 +10,7 @@ var minWastedSpace = function(packages, boxes) {
910
for(let i=0;i<packages.length;i++){
1011
totalPackagesSize+=BigInt(packages[i]);
1112
}
12-
13+
1314
for(let i=0;i<boxes.length;i++){
1415
boxes[i].sort(function(a,b){return a-b});
1516
p=0;
@@ -27,7 +28,7 @@ var minWastedSpace = function(packages, boxes) {
2728
}
2829
}
2930
}
30-
if(p===packages.length){//Check if the current supplier was able to pack all the packages.
31+
if(p===packages.length){//Check if the current supplier was able to pack all the packages.
3132
if(totalBoxesAreaForSupplier<minBoxesAreaForAnySupplier){
3233
minBoxesAreaForAnySupplier = totalBoxesAreaForSupplier;
3334
}
@@ -39,7 +40,6 @@ var minWastedSpace = function(packages, boxes) {
3940
return -1;
4041
}
4142

42-
4343
function binaryLowerBound(arr,left,right,key){
4444
let mid,ans=-1;
4545
while(left<=right){
@@ -53,4 +53,4 @@ var minWastedSpace = function(packages, boxes) {
5353
}
5454
return ans;
5555
}
56-
};
56+
};

0 commit comments

Comments
 (0)