โ† Amazon questions

Next higher permutation of a large number

Filed under Amazon

Given a number represented as a string, find the next lexicographically larger permutation of its digits. Return -1 if no such permutation exists.

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 Amazon questions

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