题解 | #字典序排列#

字典序排列

http://www.nowcoder.com/practice/de49cf70277048518314fbdcaba9b42c

# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param n int整型 
# @return int整型一维数组
#
class Solution:
    def orderArray(self , n: int) -> List[int]:
        # write code here
        res = [str(x) for x in range(1, n+1)]
        res.sort()
        return list(map(int, res))
全部评论

相关推荐

面试了几家,全程问项目,八股一点都不问,可惜准备了这么久
独角仙梦境:现在感觉问八股像是中场休息一样的,问几个八股放松一下再上强度
点赞 评论 收藏
分享
评论
4
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务