NeetCode #323LC-1721MediumLinked List
← Back to All Problems#323 · #1721 · Swapping Nodes in a Linked List(交换链表中的节点)
📌 Problem Statement & Constraints
You are given the head of a linked list and an integer
k. Swap the values of the k-th node from the beginning and the k-th node from the end, and return the head. k is 1-indexed. Constraints: 1 <= n <= 10^5, 1 <= k <= n, 0 <= Node.val <= 100.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!