Given a string S of length N, find the longest palindromic substring in S. Substring of string S: S[ i . . . . j ] where 0 ≤ i ≤ j < len(S). Palindrome string: A string which reads the same backwards.
int res = contiguousStrings(str, i + 1, j, n - 1) + contiguousStrings(str, i, j - 1, n - 1) - contiguousStrings(str, i + 1, j - 1, n - 2); ...