One line python solution. Just for fun


  • 0
    A
    class Solution:
        # @param {integer[]} nums
        # @return {string}
        def largestNumber(self, nums):
          return str(int("".join(sorted(map(str, nums), cmp=lambda a,b: -1 if a+b > b+a else (0 if a+b == b+a else 1)))))

Log in to reply
 

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