Exercises/#20 Decode Ways
#20

Decode Ways

MediumπŸ”€ Strings
90 XP

Problem

'A'β†’1, 'B'β†’2, ..., 'Z'β†’26. Given a string of digits, return the number of ways to decode it.

Examples

Input: s = '12'
Output: 2 ('AB' or 'L')

Input: s = '226'
Output: 3 ('BZ','VF','BBF')

Input: s = '06'
Output: 0
dynamic-programmingstring
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

20 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features