NeetCode #360LC-402MediumStack
← Back to All Problems

#360 · #402 · Remove K Digits(移掉 K 位数字)

📌 Problem Statement & Constraints

Given a non-negative integer as a string num and an integer k, remove k digits so that the remaining number is the smallest possible, preserving the relative order of the remaining digits. Return the result as a string with no leading zeros (use "0" if the result is empty). Constraints: 1 <= k <= num.length <= 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!