Skip to content

Commit 88c9cc0

Browse files
author
dwipam
committed
Sort max
1 parent e900edb commit 88c9cc0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

practice/sort_max_number.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
a = [54, 546, 548, 60]
2+
3+
for j in range(len(a)):
4+
for i in range(len(a)-1):
5+
if str(a[i])+str(a[i+1]) < str(a[i+1]) + str(a[i]):
6+
temp = a[i]
7+
a[i] = a[i+1]
8+
a[i+1] = temp
9+
print ''.join(map(lambda x : str(x),a))

0 commit comments

Comments
 (0)