Solution in python 3 language


#1

def largestNumber(self, A):
def getNum(num, n):
num = str(num)
num = num*n
return int(num[:n])

    size = 0
    for i in A:
        size = max(size, len(str(i)))
        
    size += 1
    d = []
    for i in A:
        d.append([i,getNum(i, size)] )
        
    d = sorted(d, key=lambda x: -x[1])
    
    ans =""
    for i in d:
        ans = ans + str(i[0])
    # print(d)
    return int(ans)