Problem. Given a string s, return its longest contiguous substring that is a palindrome.
s = "babad" → "bab" (or "aba")
s = "cbbd" → "bb"
This is an interval DP: the state is a range [i, j], and a range is a palindrome when its two ends match and the range strictly inside is a palindrome. That inside-out structure also suggests a simpler method: grow palindromes outward from their centres.
ML context. Symmetric and repeated spans matter in text and sequence data: detecting degenerate generations that mirror or repeat themselves, finding palindromic motifs in DNA (restriction sites, hairpin structures), and as a classic exercise in interval DP, the pattern behind parsing algorithms like CKY that build a parse tree over spans of a sentence.