Skip to content
Open
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
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10431,23 +10431,13 @@ We can implement the aggregate ```list-of-marks``` as an array.
}

public int getMaximumMark() {
int max = Integer.MIN_VALUE;
for(int mark:marks) {
if(mark > max) {
max = mark;
}
}
return max;
Arrays.sort(marks);
return marks[marks.length-1];
}

public int getMinimumMark() {
int min = Integer.MAX_VALUE;
for(int mark:marks) {
if(mark < min) {
min = mark;
}
}
return min;
public int getMinimumMark() {
Arrays.sort(marks);
return marks[0];
}
}

Expand Down