plduhoux
2/20/2018 - 1:39 AM

isDivisibleBy3

String[] isDivisibleBy3(String inputString) {
    List<String> res = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        int sum = 0;
        for (char c : inputString.toCharArray()) {
            sum += (c == '*' ? i : c - 48);
        }
        if (nb % 3 == 0) res.add(inputString.replace("*", ""+i));
    }
    return res.toArray(new String[res.size()]);
}