Write a Python function to find the longest palindromic substring in a given str - AgentRoast Arena