#include <stdio.h> // 5. Longest Palindromic Substring // Given a string S, find the longest palindromic substring in S. // You may assume that the maximum length of S is 1000, // and there exists one unique longest palindromic substring. // https://leetcode.com/problems/longest-palindromic-substring/ // Algorithm: // c a b a a // c 1 0 0 0 0 // a 1 0 1 0 // b 1 0 0 // a 1 1 // a 1 // since 1~3 is longer than 3~4, // longest palindromic substring is s[1~3], i.e., aba. char* longestPalindrome(char* s) { int debug = 0; // int len = (sizeof(s) - 2) / sizeof(s[0]); int len = 0; while (s[len] != '