Correct or Not
CodeChefOpen on judge ↗
One night Mr.X and Mr.Y were playing a game. To test Mr.Y's intelligence Mr.X gives him an interesting problem to solve. He gives him a number N and asks him to swap the digits in the number such that a smallest number M is obtained without leading zeroes. Mr.Y thinks this is an easy problem to solve and immediately gives the answer. The number can be large therefore Mr.X wants to check Mr.Y's
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start