Longest Palindromic Substring

Did someone get the actual logic behind the algorithm for Leetcode question 5? It’d be nice if someone can post an example and walk me thrugh