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