Java | Recursion approach | Beats 90%
Code
# Code
```java []
class Solution {
    public boolean hasSameDigits(String s) {
        var chars = new ArrayList<Integer>();
        for (int i = 0; i < s.length(); i++) {
            chars.add(s.charAt(i) - '0');
        }
        return hasSameDigits(chars);
    }

    boolean hasSameDigits(ArrayList<Integer> chars) {
        if (chars.size() == 2) {
            return chars.get(0) == chars.get(1);
        } else {
            var newChars = new ArrayList<Integer>();
            for (int i = 0; i < chars.size() - 1; i++) {
                newChars.add((chars.get(i) + chars.get(i + 1)) % 10);
            }
            return hasSameDigits(newChars);
        }
    }
}
```
['Java']