Posts

Showing posts with the label Coding Challenge

Longest palindrome substring

/***Compute the longest palindrome substring ***/ #include <iostream> #include <string> using namespace std; bool isPalindrom(string str, int start, int end) {        if (start == end || start > end) return true ;        while (start != end && start < end)        {               if (str[start] != str[end]) return false ;               else {                      start += 1;                      end -= 1;               }        }   ...