Java Solution || 6ms 
Approach
Start with a string sb
simulate till the length of string is greater than 2
Start with empty string nextsb
get the 1st 2 characters
compute the modulo

# Approach
- Start with a string sb
- simulate till the length of string is greater than 2
  - Start with empty string nextsb
    - get the 1st 2 characters
    - compute the modulo
    - append to nextsb
  - this nextsb is now the string sb
- Return true if  char at index 0 is equal to char at index 1
- else return false 
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```java []
class Solution {
    public boolean hasSameDigits(String s) {
        StringBuilder sb = new StringBuilder(s);
        while (sb.length() > 2) {
            StringBuilder nextSb = new StringBuilder();
            for (int i = 0; i < sb.length() - 1; i++) {
                int a = sb.charAt(i) - '0';
                int b = sb.charAt(i + 1) - '0';
                nextSb.append((char)('0' + (a + b) % 10));
            }
            sb = nextSb;
        }
        return sb.charAt(0) == sb.charAt(1);
    }
}

```
['String', 'Java']