José Marcelo Auler

José Marcelo Auler J.Marcelo Auler

Niner since 2008

Comments

  • Gary Daniels and Evan Goldring - Mock whiteboard problem

    Ok, I know this is an old question, but I will post my code for the problem, but using 8bit chars, I think this does not change the overall solution : )

    bool isPalyndrome(const char* aStr)
    {

            if ( aStr == NULL ) return false;
            int size = strlen(aStr);
            --size;
            for( int i = 0; i < size/2; i++ )
            {
                if ( aStr[i] != aStr[size -1 -i] )
                    return false;
            }
            return true;
     }