Java
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) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i <= s.length(); i++) {
               if(i+1<s.length()){
                   if(s.length()==1){
                       return false;
                   }
                int x = ((Character.getNumericValue(s.charAt(i)) + Character.getNumericValue(s.charAt(i + 1))) % 10);
                builder.append(x);
                if (builder.length() == s.length() - 1) {
                    s = s.replace(s, builder);
                    if ((s.length() == 2) && (s.chars().distinct().count() == 1)) {
                        return true;
                    }
                    builder = new StringBuilder(builder.toString().replace(builder, ""));
                    i = -1;
                }
            }
        }

        return false;
    }
}

```
['Java']