Simple C simluation 100% runtime 94.97% memory
IntuitionOkay so.... we need to repeatedly modify the string by replacing adjacent digits with their sum modulo 10 until the string length reduces to exactly 2
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Okay so.... we need to repeatedly modify the string by replacing adjacent digits with their sum modulo 10 until the string length reduces to exactly 2 characters. At that point, we check if those two characters are the same.

Instead of allocating new memory at each step, we modify the string in place using a pointer. This way, we avoid unnecessary space allocations and memory management (like freeing memory), making the approach more efficient. ( yipppee pointers -(๑☆‿ ☆#)ᕗ )

The problem description tells us that the initial string is longer than the desired size, so we don’t need to check edge cases related too-short strings.

Given its repetitive operations on the string, recursion seems like a natural approach. We’ll keep reducing the size of the string with each recursive call until it’s reduced to two characters. In each step, we add adjacent digits, take the modulo 10, and update the string in place. The recursive calls will stop once we have exactly 2 characters, and at that point, we’ll compare them to determine if they’re the same.
# Approach
<!-- Describe your approach to solving the problem. -->
Here is a simple summary of what the code is doing:

    Base Case: When the string has 2 characters, check if they are equal.

    Recursive Case: Iterate through the string, 
                        modify adjacent digits in place, 
                    reduce the string size, 
                    and call the function recursively with the 'updated' string.

# Complexity
- Time complexity: $$O(n^2)$$ (though its more like $$O(\frac{n(n-1)}{2})$$)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: $$O(n)$$ (* We can probably reduce this by using a while loop instead, because recusive call build up on the stack but to lazy to do that :p *)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```c []
bool hasSameDigits(char* s) {
    if (*(s + 2) == '\0') return s[0] == s[1];

    char* holder = s;
    while (*(holder + 1) != '\0') {
        (*holder) = (((*holder - '0') + (*(holder + 1) - '0')) % 10) + '0';
        holder++;
    }
    *(holder) = '\0';

    return hasSameDigits(s);
}
```
['C']