Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source