Skip to content

Commit ac2a849

Browse files
update 826
1 parent 3574718 commit ac2a849

File tree

1 file changed

+1
-0
lines changed
  • src/main/java/com/fishercoder/solutions/firstthousand

1 file changed

+1
-0
lines changed

Diff for: src/main/java/com/fishercoder/solutions/firstthousand/_826.java

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public int maxProfitAssignment(int[] difficulty, int[] profit, int[] worker) {
1515
Collections.sort(jobs, (a, b) -> a[0] - b[0]);
1616

1717
//update the profit values: because a later (with more difficult) job must be able to handle a prior job, so we take the more profitable one
18+
//this makes this jobs list in non-decreasing order in both dimensions
1819
for (int i = 0; i < jobs.size() - 1; i++) {
1920
jobs.get(i + 1)[1] = Math.max(jobs.get(i)[1], jobs.get(i + 1)[1]);
2021
}

0 commit comments

Comments
 (0)