Skip to content

Commit

Permalink
Create Largest Number.py
Browse files Browse the repository at this point in the history
  • Loading branch information
resorcap committed Mar 8, 2015
1 parent 58c7450 commit b3e2a56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Largest Number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Solution:
def largestNumber(self, num):
num = [str(x) for x in num]
num.sort(cmp = lambda x, y: cmp(y+x, x+y))
return ''.join(num).lstrip('0') or '0'

0 comments on commit b3e2a56

Please sign in to comment.