C++ Solution
Code


# Code
```cpp []
class Solution {
public:
    bool hasSameDigits(string s) {
        while(s.size()>2)
        {
            string str="";
            for(int i=0;i<s.size()-1;i++)
            {
                int x=s[i]-'0';
                int y=s[i+1]-'0';
                int sum=(x+y)%10;
                char ch=sum+'0';
                str+=ch;
            }
            s=str;
        }
        if(s[0]==s[1]) return true;
        else return false;
        
    }
};
```
['C++']