python3 solution beats 95.15%
IntuitionPerform operations till we shrink the list's length to 2ApproachStack based approachComplexity
Time complexity:

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

Perform operations till we shrink the list's length to 2
# Approach
<!-- Describe your approach to solving the problem. -->
Stack based approach
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    Close to O(N^2)

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

# Code
```python3 []
class Solution:
    def hasSameDigits(self, s: str) -> bool:
        ls = list(s)
        for i in range(0, len(ls)-1):
            ls[i] = (int(ls[i]) + int(ls[i+1])) % 10
        ls.pop()
        while len(ls) != 2:
            for i in range(0, len(ls)-1):
                ls[i] = (ls[i] + ls[i+1]) % 10
            ls.pop()
        return ls[0] == ls[1]

```
['Array', 'Python3']