我试图通过比较字符串的连接来对字符串数组进行排序,这样当你连接数组中的所有字符串时,你会得到最大值。但是,我在排序函数中不断收到错误: ValueError: need more than 1 value to unpack
nums = ['3', '30', '34', '5', '9']
nums.sort(key = lambda (x,y): cmp(x+y,y+x))
# should get me ['9', '5', '34', '3', '30']
# instead, gets me the exception ValueError: need more than 1 value to unpack
为什么会这样?我不能在排序函数中比较这样的值吗?问题的灵感来自https://leetcode.com/problems/largest-number/