knrt.net
当前位置:首页 >> 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 = '...

网站首页 | 网站地图
All rights reserved Powered by www.knrt.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com