Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
Given a digit string and a budget k of adjacent swaps, produce the lexicographically smallest string obtainable by performing at most k adjacent swaps. The core challenge is a greedy selection of the smallest digit that can be moved to each position within the remaining swap budget, which requires efficient tracking of positions/swaps (order-statistics) for large n and k.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.