加载中...
import java.util.*; /* public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } }*/ public class Solution { public ListNode FindKthToTail(ListNode head,int k) { } }
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead, unsigned int k) { } };
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def FindKthToTail(self, head, k): # write code here
/* public class ListNode { public int val; public ListNode next; public ListNode (int x) { val = x; } }*/ class Solution { public ListNode FindKthToTail(ListNode head, int k) { // write code here } }
/*function ListNode(x){ this.val = x; this.next = null; }*/ function FindKthToTail(head, k) { // write code here } module.exports = { FindKthToTail : FindKthToTail };
val = $x; } }*/ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ function FindKthToTail( $k , $head ) { // write code here }
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def FindKthToTail(self, head, k): # write code here
package main import . "nc_tools" /* * type ListNode struct{ * Val int * Next *ListNode * } */ /** * * @param pListHead ListNode类 * @param k int整型 * @return ListNode类 */ func FindKthToTail( pListHead *ListNode , k int ) *ListNode { // write code here }
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param pListHead ListNode类 * @param k int整型 * @return ListNode类 */ struct ListNode* FindKthToTail(struct ListNode* pListHead, int k ) { // write code here }
# class ListNode # attr_accessor :val, :next # # def initialize(val = 0, _next = nil) # @val, @next = val, _next # end # end # # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # @param k int整型 # @param head ListNode类 # @return ListNode类 # class Solution def FindKthToTail(k, head) # write code here end end
/** * class ListNode(var val: Int) { * var next: ListNode = null * } */ object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ def FindKthToTail(k: Int,head: ListNode): ListNode = { // write code here } }
/** * class ListNode(var `val`: Int) { * var next: ListNode? = null * } */ object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ fun FindKthToTail(k: Int,head: ListNode?): ListNode? { // write code here } }
import java.util.*; /* * public class ListNode { * int val; * ListNode next = null; * public ListNode(int val) { * this.val = val; * } * } */ public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ public ListNode FindKthToTail (int k, ListNode head) { // write code here } }
/*class ListNode { * val: number * next: ListNode | null * constructor(val?: number, next?: ListNode | null) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } * } */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ export function FindKthToTail(k: number, head: ListNode): ListNode { // write code here }
/** * public class ListNode { * public var val: Int * public var next: ListNode? * public init(_ val: Int = 0, _ next: ListNode? = nil) { * self.val = val * self.next = next * } * } */ public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ func FindKthToTail ( _ k: Int, _ head: ListNode?) -> ListNode? { // write code here } }
/** * #[derive(PartialEq, Eq, Debug, Clone)] * pub struct ListNode { * pub val: i32, * pub next: Option
> * } * * impl ListNode { * #[inline] * fn new(val: i32) -> Self { * ListNode { * val: val, * next: None, * } * } * } */ struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param k int整型 * @param head ListNode类 * @return ListNode类 */ pub fn FindKthToTail(&self, k: i32, head: Option
>) -> Option
> { // write code here } }
1,{1,2,3,4,5}
{5}