1-Line JavaScript code


  • 0
    Z

    /**

    • @param {number[][]} matrix
    • @param {number} k
    • @return {number}
      */
      var kthSmallest = function(matrix, k) {
      return matrix.join(',').split(',').map(x => parseInt(x)).sort((a, b) => (a - b))[k - 1];
      };

Log in to reply
 

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