We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ba9481 commit c4f1c91Copy full SHA for c4f1c91
reorder_array_to_construct_the_minimum_number.py
@@ -0,0 +1,8 @@
1
+class Solution:
2
+ # @param {int[]} nums n non-negative integer array
3
+ # @return {str} a string
4
+ def minNumber(self, nums):
5
+ # Write your code here
6
+ # 修改一下排序规则就可以了
7
+ nums.sort(lambda x, y: cmp(str(x) + str(y), str(y) + str(x)))
8
+ return str(int(''.join(str(i) for i in nums))) # 把前面的0都去掉
0 commit comments