# -*- coding:utf-8 -*- from heapq import nsmallest class Solution: def GetLeastNumbers_Solution(self, tinput, k): # return sorted(tinput, reverse=False)[0:k] # write code here return nsmallest(k, tinput)
# -*- coding:utf-8 -*- from heapq import nsmallest class Solution: def GetLeastNumbers_Solution(self, tinput, k): # return sorted(tinput, reverse=False)[0:k] # write code here return nsmallest(k, tinput)