← Questions

Maximum swap

0
MetaCodingLast asked Jul 2025

Given a non-negative integer, swap two of its digits at most once to make the largest number possible. Record the last position of each digit, then find the first digit that has a larger digit later on.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding