✅🔥Easy to  Understand | C++ Code 
ApproachLoop and replace the string till the size of p not becomes 2Code


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

Loop and replace the string till the size of p not becomes 2 


# Code
```cpp []
class Solution {
public:
    bool hasSameDigits(string s) {

        int n = s.size();
        int tk = n - 1;
        string p = s;
        while (p.size() != 2) {
            string pp = "";
            for (int i = 0; i < p.size() - 1; i++) 
            {

                int a = p[i] - '0';
                int b = p[i + 1] - '0';

                char t = static_cast<char>(((a + b) % 10+'0'));

                pp += t;
            }
            // cout<<pp<<"\n";
            p=pp;
        }

        return p[0]==p[1];
    }
};
```
['C++']