โ† Amazon questions

Number of ways to decode a string

Filed under Amazon

Given a numeric string, return the total number of ways to decode it into letters based on the mapping '1' -> A, '2' -> B, ..., '26' -> Z. Ignore leading zeros and handle invalid decodings.

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.