利用回溯法(深搜)搜索答案。
#include <iostream>
#include <vector>
using namespace std;
bool isline(string s, int start, int end)
{
while(s[start] == s[end]){
start++;
end--;
}
return start >= end;
}
void dfs(string s, vector<string> path,