NeetCode #198LC-2161MediumTwo Pointers
← Back to All Problems#198 · #2161 · Partition Array According to Given Pivot(根据给定数字划分数组)
📌 Problem Statement & Constraints
Given an integer array
nums and an integer pivot, rearrange nums so that elements less than pivot come first, then elements equal to pivot, then elements greater than pivot, preserving the relative order within each group. Constraints: 1 <= nums.length <= 10^5, -10^5 <= nums[i], pivot <= 10^5.🔒
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!