Apasă pe pagină pentru a deschide meniul rapid
Ea s-aCodecs:
```c++
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// Function to check if a string is a palindrome
bool isPalindrome(const string& str) {
string reversed_str = str;
reverse(reversed_str.begin(), reversed_str.end());
return str == reversed_str;
}
// Function to find the longest palindromic substring
string longestPalin