[PYTHON] ** 6 Lines of Codes Beats 100% **
IntuitionAdd the new elements to the end and remove old digits.Complexity

Time complexity:O(n)


Space complexity:O(1)

Code
# Intuition
Add the new elements to the end and remove old digits. 

# Complexity
- Time complexity: $$O(n)$$

- Space complexity: $$O(1)$$

# Code
```python []
class Solution(object):
    def hasSameDigits(self, s):
        """
        :type s: str
        :rtype: bool
        """
        while len(s) > 2: 
            n = len(s)
            for i in range(0, n-1): 
                s += str((int(s[i])+ int(s[i+1]))% 10)
            s = s[n:]
        
        return s[0] == s[1]
            
            
```
['Recursion', 'Python']