Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1053. Previous Permutation With One Swap
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.
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.