Available question text
Given an array of integers, return the lexicographically largest permutation that is smaller than the original and can be obtained with exactly one swap (or the original if none exists). The core challenge is choosing which pair to swap—find the rightmost position where a decrease is possible and exchange it with the largest smaller distinct value to its right.
Related questions
Continue with questions that share topics or the same question type.
- Check if One String Swap Can Make Strings Equal
Coding
- Longest Balanced Substring With One Swap
Coding
- Alert Using Same Key-Card Three or More Times in a One Hour Period
Coding
- All O`one Data Structure
Coding · Design · Doubly-Linked List · Hash Table
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 1053. Previous Permutation With One Swap
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source