Skip to content

Improved task 352 #1955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/g3401_3500/s3457_eat_pizzas/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// #Medium #Array #Sorting #Greedy #2025_02_21_Time_16_ms_(100.00%)_Space_75.98_MB_(97.29%)

class Solution {
public class Solution {
public long maxWeight(int[] pizzas) {
int max = 0;
for (int x : pizzas) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,27 @@
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class SummaryRangesTest {
private SummaryRanges summaryRanges;

@BeforeEach
void setup() {
summaryRanges = new SummaryRanges();
}

@Test
void getIntervals() {
SummaryRanges summaryRanges = new SummaryRanges();
summaryRanges.addNum(1);
assertThat(summaryRanges.getIntervals(), equalTo(new int[][] {{1, 1}}));
}

@Test
void getIntervals2() {
SummaryRanges summaryRanges = new SummaryRanges();
summaryRanges.addNum(1);
summaryRanges.addNum(3);
assertThat(summaryRanges.getIntervals(), equalTo(new int[][] {{1, 1}, {3, 3}}));
}

@Test
void getIntervals3() {
SummaryRanges summaryRanges = new SummaryRanges();
summaryRanges.addNum(1);
summaryRanges.addNum(3);
summaryRanges.addNum(7);
Expand All @@ -37,6 +32,7 @@ void getIntervals3() {

@Test
void getIntervals4() {
SummaryRanges summaryRanges = new SummaryRanges();
summaryRanges.addNum(1);
summaryRanges.addNum(2);
summaryRanges.addNum(3);
Expand All @@ -46,6 +42,7 @@ void getIntervals4() {

@Test
void getIntervals5() {
SummaryRanges summaryRanges = new SummaryRanges();
summaryRanges.addNum(1);
summaryRanges.addNum(2);
summaryRanges.addNum(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.jupiter.api.Test;

class SolutionTest {

@Test
void testMaxEnvelopes() {
assertThat(
Expand Down