Strange compilation error. Works fine in IntelliJ.


  • 0
    Z

    Why the compiler always complain about the following code "IllegalArguments"? It just compiles in IntelliJ.

    PriorityQueue<ListNode> pq = new PriorityQueue<ListNode>(lists.length,new Comparator<ListNode>(){
                @Override
                public int compare(ListNode a, ListNode b) {
                    return a.val - b.val;
                }
            });
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.