NeetCode #819LC-670MediumGreedy
← Back to All Problems

#819 · #670 · Maximum Swap(最大交换)

📌 Problem Statement & Constraints

You are given an integer num. You may swap two digits at most once to get the maximum valued number. Return the maximum value you can get. Constraints: 0 <= num <= 10^8.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!