All Problems

Decode Ways

MediumarrayExpected: O(n) time, O(n) spaceInterview Context

Problem

Given a string containing only digits, return the number of ways to decode it where A=1, B=2, ..., Z=26.

Loading...