public int numDecodings(String s) {
        // Start typing your Java solution below
        // DO NOT write main() function
        if (s == null || s.equals("")) return 0;
        char[] cc = s.toCharArray(); //conver to char array
        int n = s.length(); //number of chars
        boolean[] en1 = new boolean[n];
        boolean[] en2 = new boolean[n];
        for (int i = 0; i < n-1; i++) {
            if (cc[i] >= '1' && cc[i] <= '9') en1[i] = true;
            if (s.substring(i,i+2).compareTo("10") >= 0 
                    && s.substring(i,i+2).compareTo("26") <= 0) 
                en2[i] = true;
        }
        if (cc[n-1] >= '1' && cc[n-1] <= '9') {
            en1[n-1] = true;
            //return 10;
        }
        
//        System.out.println(Arrays.toString(en1));
//        System.out.println(Arrays.toString(en2));
        
        int[] numEn = {0}; 
        dsf(en1, en2, 0, numEn);        
        return numEn[0];
    }