Decode Ways 2

Title: Decode Ways Source: leetcode.com

A message containing letters from A-Z is being encoded to numbers using the following mapping:

Given an encoded message containing digits, determine the total number of ways to decode it.

For example,
Given encoded message "12",
could be decoded as "AB" (1 2) or "L" (12).

The number of ways decoding "12" is 2.

Java solution

Rate this post

2 thoughts on “Decode Ways

  1. Reply AS May 1,2016 6:22 pm

    Bloody aweful..!

  2. Reply Ritesh Jun 22,2016 8:53 pm

    Will give wrong answer when input is “0”.

Leave a Reply