What is wrong with my code (Recursion - codes of String )

import java.util.*;
public class Main {
    public static void f(char c[], int i, int n, String s, List<String> ans) {
        if (i == n) {
            // System.out.println(s);
			ans.add(s);
            return;
        }
        int number = c[i] - '0';
        f(c, i + 1, n, s + (char)('a' + number - 1), ans);
        if (i + 1 != n) {
            number = (c[i] - '0') * 10 + (c[i + 1] - '0');
            f(c, i + 2, n, s + (char)('a' + number - 1), ans);
        }
    }
    public static void main(String args[]) {
        // Your Code Here
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c[] = s.toCharArray();
		ArrayList<String> ans = new ArrayList<>();
        f(c, 0, c.length, "", ans);
		int n = ans.size();
		System.out.printf("[");
		for ( int i = 0; i < n; i += 1) {
			System.out.printf("%s", ans.get(i));
			if (i + 1 != n) System.out.printf(", ");
		}
		System.out.printf("]");
    }
}