1-Line JavaScript Code Solution


  • 0
    Z

    /**

    • @param {number[]} nums
    • @return {string}
      */
      var largestNumber = function(nums) {
      return nums.sort((a, b) => ((b + "" + a) - (a + "" + b)))[0] === 0 ? '0' : nums.sort((a, b) => ((b + "" + a) - (a + "" + b))).join('');
      };

Log in to reply
 

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