Maximum Swap at Meta
Medium51.9% acceptance
This problem has 75.0% frequency at Meta.
Problem Description
You are given an integer `num`. You can swap two digits at most once to get the maximum valued number. Return _the maximum valued number you can get_.
Read full problem and hintsTopics
Also asked at 7 companies
More Meta Questions
Valid Palindrome IIEasyPow(x, n)MediumBasic Calculator IIMediumRandom Pick with WeightMediumAdd Two NumbersMedium
View all Meta questions