E
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public boolean hasSameDigits(String s) {
        char[] ss = s.toCharArray();
        int n = s.length();

        while (n > 2) {
            char[] temp = new char[n - 1];
            for (int i = 1; i < ss.length; i++) {
                int x = (ss[i - 1] - '0') + (ss[i] - '0');
                temp[i - 1] = (char) ((x % 10) + '0');
            }
            ss = temp;
            n--;
        }
        return (ss.length == 2) && (ss[0] == ss[1]);
    }
}
```
['Java']