The question description is wrong for JS


  • 0
    R

    The input is not an array of lists, but an array of array of numbers.

    /**
     * Definition for singly-linked list.
     * function ListNode(val) {
     *     this.val = val;
     *     this.next = null;
     * }
     */
    /**
     * @param {ListNode[]} lists
     * @return {ListNode}
     */
    var mergeKLists = function (lists) {
    

    should be:

    /**
     * @param {number[][]} lists
     * @return {number[]}
     */
    var mergeKLists = function (lists) {
    }
    

Log in to reply
 

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