This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
cs-142:substrings-and-palindromes [2015/05/28 14:23] cs142ta [Problem] |
cs-142:substrings-and-palindromes [2015/05/28 14:23] cs142ta [Solution] |
||
---|---|---|---|
Line 23: | Line 23: | ||
bool is_palindrome(string str) | bool is_palindrome(string str) | ||
{ | { | ||
- | bool this_is_palindrome = true; | ||
- | |||
// base case | // base case | ||
if (str.length() <= 1) | if (str.length() <= 1) |