Skip to content

Commit 606b0dd

Browse files
refactor 23
1 parent 2c8d3da commit 606b0dd

File tree

1 file changed

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

1 file changed

+1
-6
lines changed

src/main/java/com/fishercoder/solutions/_23.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
public class _23 {
1515

1616
public ListNode mergeKLists(ListNode[] lists) {
17-
PriorityQueue<ListNode> heap = new PriorityQueue(new Comparator<ListNode>() {
18-
@Override
19-
public int compare(ListNode o1, ListNode o2) {
20-
return o1.val - o2.val;
21-
}
22-
});
17+
PriorityQueue<ListNode> heap = new PriorityQueue((Comparator<ListNode>) (o1, o2) -> o1.val - o2.val);
2318

2419
for (ListNode node : lists) {
2520
if (node != null) {

0 commit comments

Comments
 (0)