← Morgan Stanley questions

Lexicographically smallest number

Filed under Morgan Stanley

Given a positive integer represented as a string, find the lexicographically smallest number possible by rearranging its digits, ensuring the resulting number does not have a leading zero.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.