当前位置:首页 >> FunCtools.Cmp to kEy >>

FunCtools.Cmp to kEy

使用functools.cmp_to_key 即可。 附通过的代码: class Solution: # @param {integer[]} nums # @return {string} def largestNumber(self, nums): from functools import cmp_to_key key = cmp_to_key(lambda x,y: int(y+x)-int(x+y)) res = '...

Use functools.cmp_to_key() to convert an old-style cmp function to a key function.Changed in version 2.3: Support for None as an equivalent to ...

网站首页 | 网站地图
All rights reserved Powered by
copyright ©right 2010-2021。