fxbrain

fxbrain fxbrain

Niner since 2005

Comments

  • Gary Daniels and Evan Goldring - Mock whiteboard problem

    Why no one sees the obvious solution using regular
    C++ standard library facility:

    bool is_palindrome(const string& s) {
       return equal(s.begin(), s.end(), s.rbegin());
    }


    The equal funcition assumes that the second sequence is the same size as the first, so it does not need
    and ending iterator.


    Stefan