100% Affective CPP Solution
IntuitionApproachComplexity

Time complexity:O(n^2)


Space complexity:O(1)

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

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

# Complexity
- Time complexity:
O(n^2)

- Space complexity:
O(1)

# Code
```cpp []
class Solution {
public:
    bool hasSameDigits(string s) {
        if(s.length()<3) return s[0]==s[1]?true:false;

        while(true)
            {
                for(int i=0;i<s.length()-1;i++)
                    {
                        s[i]=(s[i]+s[i+1])%10;
                    }
                s.pop_back();
                if(s.length()==2) return s[0]==s[1]?true:false;    
            }
    }
};
```
['C++']