104: Longest palindromic substring

Given a string, return the longest palindromic substring of a given string

A palindrome is a string that reads the same backward as forward. For instance, level, baab

 

Example 1

Input:   abac

Output:  aba

Example 2

Input:   acdbba

Output:  bb
Difficulty:Medium
Topic:Dynamic programming
Problem #:104