8000 add 2525 · githubniraj/Leetcode@db813b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit db813b7

Browse files
add 2525
1 parent 4892be1 commit db813b7

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------------------------------|-------------
11-
| 2530 |[Maximal Score After Applying K Operations](https://leetcode.com/problems/maximal-score-after-applying-k-operations/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2530.java) |[:tv:](https://youtu.be/nsOipmYbRlc)| Medium |
11+
| 2530 |[Maximal Score After Applying K Operations](https://leetcode.com/problems/maximal-score-after-applying-k-operations/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2530.java) |[:tv:](https://youtu.be/nsOipmYbRlc)| Medium |
1212
| 2529 |[Maximum Count of Positive Integer and Negative Integer](https://leetcode.com/problems/maximum-count-of-positive-integer-and-negative-integer/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2529.java) |[:tv:](https://youtu.be/4uhvXmOp5Do)| Easy ||
13+
| 2525 |[Categorize Box According to Criteria](https://leetcode.com/problems/categorize-box-according-to-criteria/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2525.java) || Easy ||
1314
| 2520 |[Count the Digits That Divide a Number](https://leetcode.com/problems/count-the-digits-that-divide-a-number/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2520.java) | [:tv:](https://youtu.be/7SHHsS5kPJ8) | Easy ||
1415
| 2515 |[Shortest Distance to Target String in a Circular Array](https://leetcode.com/problems/shortest-distance-to-target-string-in-a-circular-array/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2515.java) || Easy ||
1516
| 2496 |[Maximum Value of a String in an Array](https://leetcode.com/problems/maximum-value-of-a-string-in-an-array/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2496.java) || Easy ||
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2525 {
4+
public static class Solution1 {
5+
public String categorizeBox(int length, int width, int height, int mass) {
6+
int DIMENSION_LIMIT = 10000;
7+
int VOLUME_LIMIT = 1000000000;
8+
boolean isBulky = false;
9+
long volume = (long) length * width * height;
10+
if (length >= DIMENSION_LIMIT || width >= DIMENSION_LIMIT || height >= DIMENSION_LIMIT || volume >= VOLUME_LIMIT) {
11+
isBulky = true;
12+
}
13+
boolean isHeavy = mass >= 100;
14+
if (isBulky && isHeavy) {
15+
return "Both";
16+
} else if (!isBulky && !isHeavy) {
17+
return "Neither";
18+
} else if (isBulky && !isHeavy) {
19+
return "Bulky";
20+
} else {
21+
return "Heavy";
22+
}
23+
}
24+
}
25+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.solutions._2525;
4+
import org.junit.BeforeClass;
5+
import org.junit.Test;
6+
7+
import static org.junit.Assert.assertEquals;
8+
9+
public class _2525Test {
10+
private static _2525.Solution1 solution1;
11+
12+
@BeforeClass
13+
public static void setup() {
14+
solution1 = new _2525.Solution1();
15+
}
16+
17+
@Test
18+
public void test1() {
19+
assertEquals("Both", solution1.categorizeBox(2909, 3968, 3272, 727));
20+
}
21+
22+
}

0 commit comments

Comments
 (0)
0