Longest Palindromic Substring In C++Approaches discussed: Brute force and Dynamic ProgrammingBrute force approach: Time complexity O(n^3)Dynamic Programming approach: Time complexity O(n^2), Space complexity O(n^2)