题目描述:
中心对称数是指一个数字在旋转了 180 度之后看起来依旧相同的数字(或者上下颠倒地看)。
找到所有长度为 n 的中心对称数。
示例 :
输入: n = 2
输出: [“11”,“69”,“88”,“96”]
方法1:
主要思路:
(1)先找出前半段的,再根据 n 的奇偶,来处理后半段内容;
class Solution {
public:
//根据奇偶,找出前半段的内容
void helper(vector<string>& res,string& path, int n,const vector<char>&lables){
if(n<path.size()){
return;
}
if(n==path.size()){
res.push_back(path);
return;
}
for(int i=0;i