对称数是一个旋转180度后(倒过来)看起来与原数相同的数.找到所有长度为 n 的对称数.
样例:
给出 n = 2 返回 [“11”,”69”,”88”,”96”].
思路:
利用递归求解,给出n=1时,结果为{0,1,8},
n=2时,结果为{11,69,88,96}
计算n时,就先计算n-2(此时的n-2包括以0开头的字符串)
再将n=2的结果,分别加到n-2结果的两边。
#ifndef C776_H
#define C776_H
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
/**