37 lines
730 B
C++
37 lines
730 B
C++
#ifndef S0005_LONGEST_PALINDROMIC_SUBSTRING
|
|
#define S0005_LONGEST_PALINDROMIC_SUBSTRING
|
|
|
|
#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
|