Skip to content

Commit fc0ee4c

Browse files
refactor 23
1 parent 966fb21 commit fc0ee4c

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy