2022-11-21 13:15:56 +00:00
|
|
|
#ifndef S0005_LONGEST_PALINDROMIC_SUBSTRING_HPP
|
|
|
|
#define S0005_LONGEST_PALINDROMIC_SUBSTRING_HPP
|
2022-11-02 09:32:58 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class Solution1 {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Longest Palindromic Substring
|
|
|
|
*
|
|
|
|
* Given a string s, return the longest palindromic substring in s.
|
|
|
|
*
|
|
|
|
* @param s the given string
|
|
|
|
* @return longest palindromic substring
|
|
|
|
*/
|
|
|
|
string longestPalindrome(string s);
|
|
|
|
};
|
|
|
|
|
|
|
|
class Solution2 {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Longest Palindromic Substring
|
|
|
|
*
|
|
|
|
* Given a string s, return the longest palindromic substring in s.
|
|
|
|
*
|
|
|
|
* @param s the given string
|
|
|
|
* @return longest palindromic substring
|
|
|
|
*/
|
|
|
|
string longestPalindrome(string s);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|