Steve has a string, , consisting of lowercase English alphabetic letters. In one operation, he can delete any pair of adjacent letters with same value. For example, string “aabcc” would become either “aab” or “bcc” after operation.

Steve wants to reduce as much as possible. To do this, he will repeat the above operation as many times as it can be performed. Help Steve out by finding and printing ‘s non-reducible form!

bool Compress(char* pInput)
{
    if (nullptr == pInput ) !(*pInput))
        return false;

    char* pWrite = pInput;
    char previous = pInput[0];
    int count = 1;

    for (int i = 1; i < strlen(pInput) - 1; ++i)
    {
        if (pInput[i] != previous)
        {
            if( count % 2 != 0 )
                *pWrite++ = previous;
            count = 1;
        }
        else
        {
            count++;
        }

        previous = pInput[i];
    }

    if (++count % 2 != 0)
        *pWrite++ = previous;
    
    *pWrite = '\0';

    return true;
}