剑指offer-最小的K个数(python)

# -*- coding:utf-8 -*-
class Solution:
    def GetLeastNumbers_Solution(self, tinput, k):
        # write code here
        if not tinput or k>len(tinput):
            return []
        a=sorted(tinput)
        return a[0:k]
发布了69 篇原创文章 · 获赞 46 · 访问量 5259

猜你喜欢

转载自blog.csdn.net/qq_42738654/article/details/104287054
今日推荐