@@ -0,0 +1,1005 @@
+package leetcode.decode_ways;%0A%0Apublic class Solution %7B%0A    public int numDecodings(String s) %7B%0A    %09char%5B%5D chars = s.toCharArray();%0A    %09int lens = chars.length;%0A    %09if(lens == 0) return 0;%0A    %09char prev = 0;%0A    %09int cur_end = 1, cur_prev = 0;%0A    %09for(int i = 0; i %3C lens; i++)%7B%0A    %09%09int next_end = 0, next_prev = 0;%0A    %09%09next_prev = cur_end;%0A    %09%09if(chars%5Bi%5D == '0')%7B%0A    %09%09%09if(prev == '1' %7C%7C prev == '2')%7B%0A    %09%09%09%09next_end += cur_prev;%0A    %09%09%09%7Delse%7B%0A    %09%09%09%09next_end = 0;%0A    %09%09%09%7D%0A    %09%09%7Delse%7B%0A    %09%09%09next_end = cur_end; // 1 digit ends at char%5Bi%5D%0A    %09%09%09if(prev == '2')%7B%0A    %09%09%09%09if(chars%5Bi%5D %3E= '1' && chars%5Bi%5D %3C= '6')%7B%0A    %09%09%09%09%09next_end += cur_prev; // 2 digit '2x' ends at char%5Bi%5D%0A    %09%09%09%09%7D%0A    %09%09%09%7Delse if(prev == '1')%7B%0A    %09%09%09%09next_end += cur_prev;%0A    %09%09%09%7D%0A    %09%09%7D%0A    %09%09prev = chars%5Bi%5D;%0A    %09%09cur_end = next_end;%0A    %09%09cur_prev = next_prev;%0A    %09%7D%0A    %09return cur_end;%0A    %7D%0A    %0A    public static void main(String%5B%5D args)%7B%0A    %09System.err.println(new Solution().numDecodings(%22%22));%0A    %7D%0A%7D%0A

Add java solution for 91. Decode Ways