Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 541 Bytes

File metadata and controls

16 lines (12 loc) · 541 Bytes

Problem 13: Numerical Pruning

Problem Statement

Given a non-negative integer represented as a string num, and an integer k, remove k digits from the number so that the new number is the smallest possible. The length of num is less than 10^5 and k <= len(num).

Input Format

  • A string num.
  • An integer k.

Output Format

  • A string representing the smallest possible number.

Example

Input: num = "1432219", k = 3
Output: "1219"
Explanation: Remove 4, 3, and 2 to get the smallest number "1219".