NeetCode #337LC-725MediumLinked List
← Back to All Problems#337 · #725 · Split Linked List in Parts(分隔链表)
📌 Problem Statement & Constraints
Given the head of a singly linked list and an integer
k, split the list into k consecutive parts. The parts must have sizes differing by at most 1, with the earlier parts being the larger ones. Return an array of the k heads (using null for empty parts). Constraints: 1 <= k <= 50, 0 <= number of nodes <= 1000.🔒
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!