We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 966fb21 commit fc0ee4cCopy full SHA for fc0ee4c
src/main/java/com/fishercoder/solutions/_23.java
@@ -14,12 +14,7 @@
14
public class _23 {
15
16
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
- });
+ PriorityQueue<ListNode> heap = new PriorityQueue((Comparator<ListNode>) (o1, o2) -> o1.val - o2.val);
23
24
for (ListNode node : lists) {
25
if (node != null) {
0 commit comments