Easy In-Place Solution
IntuitionApproach
Loop through S until it has 2 characters
On each loop, take pairs of chars, convert them to int
Perform the operation of adding them and modul
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
1. Loop through S until it has 2 characters
2. On each loop, take pairs of chars, convert them to int
3. Perform the operation of adding them and modulo by 10
4. Replace the first of the two digits with this new value
5. Repeat until last pair of digits.
6. Resize string to fit only new values (cuts off last value each operation)
7. Check if last two values are equal

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

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

        while (s.size() > 2)
        {
            for (int i = 1; i < s.size(); i++)
            {
                s[i-1] = ((s[i-1] - '0') + (s[i] - '0')) % 10;
            }
            s.resize(s.size()-1);
        }
        return s[0] == s[1];
    }
};
```
['C++']