加载中...
import java.util.ArrayList; public class Solution { public ArrayList
GetLeastNumbers_Solution(int [] input, int k) { } }
class Solution { public: vector
GetLeastNumbers_Solution(vector
input, int k) { } };
# -*- coding:utf-8 -*- class Solution: def GetLeastNumbers_Solution(self, tinput, k): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ public List
GetLeastNumbers_Solution (List
input, int k) { // write code here } }
function GetLeastNumbers_Solution(input, k) { // write code here } module.exports = { GetLeastNumbers_Solution : GetLeastNumbers_Solution };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param input int整型一维数组 # @param k int整型 # @return int整型一维数组 # class Solution: def GetLeastNumbers_Solution(self , input: List[int], k: int) -> List[int]: # write code here
package main /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ func GetLeastNumbers_Solution( input []int , k int ) []int { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param input int整型一维数组 * @param inputLen int input数组长度 * @param k int整型 * @return int整型一维数组 * @return int* returnSize 返回数组行数 */ int* GetLeastNumbers_Solution(int* input, int inputLen, int k, int* returnSize ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # @param input int整型一维数组 # @param k int整型 # @return int整型一维数组 # class Solution def GetLeastNumbers_Solution(input, k) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ def GetLeastNumbers_Solution(input: Array[Int],k: Int): Array[Int] = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ fun GetLeastNumbers_Solution(input: IntArray,k: Int): IntArray { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ public int[] GetLeastNumbers_Solution (int[] input, int k) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ export function GetLeastNumbers_Solution(input: number[], k: number): number[] { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ func GetLeastNumbers_Solution ( _ input: [Int], _ k: Int) -> [Int] { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param input int整型一维数组 * @param k int整型 * @return int整型一维数组 */ pub fn GetLeastNumbers_Solution(&self, input: Vec
, k: i32) -> Vec
{ // write code here } }
[4,5,1,6,2,7,3,8],4
[1,2,3,4]
[1],0
[]
[0,1,2,1,2],3
[0,1,1]