-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy path_2525.java
28 lines (27 loc) · 953 Bytes
/
_2525.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.fishercoder.solutions.thirdthousand;
public class _2525 {
public static class Solution1 {
public String categorizeBox(int length, int width, int height, int mass) {
int dimensionLimit = 10000;
int volumeLimit = 1000000000;
boolean isBulky = false;
long volume = (long) length * width * height;
if (length >= dimensionLimit
|| width >= dimensionLimit
|| height >= dimensionLimit
|| volume >= volumeLimit) {
isBulky = true;
}
boolean isHeavy = mass >= 100;
if (isBulky && isHeavy) {
return "Both";
} else if (!isBulky && !isHeavy) {
return "Neither";
} else if (isBulky && !isHeavy) {
return "Bulky";
} else {
return "Heavy";
}
}
}
}