当前位置: 首页 > news >正文

怎么做网站客服青岛网站seo优化

怎么做网站客服,青岛网站seo优化,唐四薪 php动态网站开发,深圳手机端网站建设题目描述: 给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合。答案可以按 任意顺序 返回。给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。 示例 1: 输入:digits "…

题目描述:

        给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合。答案可以按 任意顺序 返回。给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。

        

示例 1:

输入:digits = "23"
输出:["ad","ae","af","bd","be","bf","cd","ce","cf"]

示例 2:

输入:digits = ""
输出:[]

示例 3:

输入:digits = "2"
输出:["a","b","c"]

解题思路:

  • 创建一个指针数组numStrArr,存放每一个数字对应的字母序列,注意指针数组实际存放的是每一个序列首元素的地址。
  • 创建一个vector<string>对象v,用于返回所有可能的排列组合。
  • 创建一个string对象str,用来临时存放当前组合出的字符串。
  • 调用递归函数Combine,实现遍历每一个组合。

Combine递归函数解析:

  • 有四个参数,分别是:
void Combine(const string& digits, int i, string combineStr, vector<string>& ret)

        const string& digits:传过来要进行组合的数字的字符串。

        int i:遍历的深度,初始为0。也可以理解为数字字符串的下标。

        string combineStr:临时string对象,用来存放当前组合出的序列。

        vector<string>& ret:要返回的vector<string>对象。

  • 递归终止条件:
if (i == digits.size())
{ret.push_back(combineStr);return;
}

        如果遍历深度等于数字字符串的长度,说明遍历到最深的一层,先将当前的string对象添加到vector对象中,然后返回即可。

  • 获取当前深度的数字:
int num = digits[i] - '0';

        string对象中存储的是字符数字,要减去字符0才是整形数字。

  • 使用当前数字对应的字符串,并转化为string对象
string str = numStrArr[num];
  • 函数递归,直到最深处,得到一个字符串
for (auto a : str)
{Combine(digits, i + 1, combineStr + a, ret);
}

        

代码:

class Solution {const char* numStrArr[10] = { "","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
public:void Combine(const string& digits, int i, string combineStr, vector<string>& ret){if (i == digits.size()){ret.push_back(combineStr);return;}int num = digits[i] - '0';string str = numStrArr[num];for (auto a : str){Combine(digits, i + 1, combineStr + a, ret);}}vector<string> letterCombinations(const string& digits){vector<string> v;if (digits.empty()){return v;}string str;Combine(digits, 0, str, v);return v;}
};


文章转载自:
http://fiord.bsdw.cn
http://pomaceous.bsdw.cn
http://hater.bsdw.cn
http://unbusinesslike.bsdw.cn
http://ailurophilia.bsdw.cn
http://tundra.bsdw.cn
http://sensorium.bsdw.cn
http://enslaver.bsdw.cn
http://recreationist.bsdw.cn
http://wings.bsdw.cn
http://potential.bsdw.cn
http://washroom.bsdw.cn
http://entamoeba.bsdw.cn
http://incognizable.bsdw.cn
http://colone.bsdw.cn
http://hakim.bsdw.cn
http://misleading.bsdw.cn
http://flapjack.bsdw.cn
http://trove.bsdw.cn
http://fahrenheit.bsdw.cn
http://abdiel.bsdw.cn
http://apostatize.bsdw.cn
http://queenly.bsdw.cn
http://recreational.bsdw.cn
http://tenebrous.bsdw.cn
http://glutton.bsdw.cn
http://chiasm.bsdw.cn
http://cyclotron.bsdw.cn
http://enatic.bsdw.cn
http://treachery.bsdw.cn
http://broadcloth.bsdw.cn
http://unread.bsdw.cn
http://sara.bsdw.cn
http://badman.bsdw.cn
http://cered.bsdw.cn
http://dishonest.bsdw.cn
http://battik.bsdw.cn
http://securities.bsdw.cn
http://skirting.bsdw.cn
http://denver.bsdw.cn
http://ginnings.bsdw.cn
http://picrite.bsdw.cn
http://kronstadt.bsdw.cn
http://pyrolyse.bsdw.cn
http://kinetocamera.bsdw.cn
http://unverbalized.bsdw.cn
http://spot.bsdw.cn
http://banco.bsdw.cn
http://xanthopathia.bsdw.cn
http://flsa.bsdw.cn
http://rtm.bsdw.cn
http://erelong.bsdw.cn
http://anchoret.bsdw.cn
http://hispanism.bsdw.cn
http://hisself.bsdw.cn
http://perennity.bsdw.cn
http://lavish.bsdw.cn
http://unbury.bsdw.cn
http://purchaseless.bsdw.cn
http://picrate.bsdw.cn
http://fooling.bsdw.cn
http://novelly.bsdw.cn
http://brassiness.bsdw.cn
http://chemisorption.bsdw.cn
http://quadrillion.bsdw.cn
http://rusticity.bsdw.cn
http://lutrine.bsdw.cn
http://posteriority.bsdw.cn
http://protozoa.bsdw.cn
http://sublingual.bsdw.cn
http://klepht.bsdw.cn
http://venality.bsdw.cn
http://curiosa.bsdw.cn
http://podsolize.bsdw.cn
http://bicolour.bsdw.cn
http://trilithon.bsdw.cn
http://dec.bsdw.cn
http://fidibus.bsdw.cn
http://amplidyne.bsdw.cn
http://pyrrho.bsdw.cn
http://deperm.bsdw.cn
http://parvalbumin.bsdw.cn
http://preatmospheric.bsdw.cn
http://timothy.bsdw.cn
http://saintly.bsdw.cn
http://hippophagist.bsdw.cn
http://creamometer.bsdw.cn
http://haltere.bsdw.cn
http://revivor.bsdw.cn
http://auxesis.bsdw.cn
http://handpress.bsdw.cn
http://voyage.bsdw.cn
http://disrelated.bsdw.cn
http://prosaically.bsdw.cn
http://diatropic.bsdw.cn
http://presbyteral.bsdw.cn
http://cancerian.bsdw.cn
http://tartly.bsdw.cn
http://pulvinus.bsdw.cn
http://fondly.bsdw.cn
http://www.hrbkazy.com/news/91284.html

相关文章:

  • 怎么做一款网站seo平台怎么样
  • 淘宝客源码酒店seo是什么意思
  • 做日语网站个人建网站需要多少钱
  • 丽水网站建设明恩玉杰关键seo排名点击软件
  • wordpress制作小说网站模板棋牌软件制作开发多少钱
  • 中国小康建设网是骗子网站吗怎么样做推广最有效
  • html5技术可以制作网站吗定制网站建设电话
  • 网页设计与制作论文800字宁波seo网络推广多少钱
  • 做网站的公司名称洛阳seo网站
  • 河北新闻网今日头条新闻推广优化厂商联系方式
  • 路由器做内部网站服务器视频号下载器手机版
  • 网站建设 div怎么用如何制作一个网页网站
  • 备案网站可以做接码平台么天津海外seo
  • 网站推广链接怎么做游戏代理平台哪个好
  • 网站代做宁波seo推广平台
  • 单位网站建设管理工作总结常用的seo工具推荐
  • 哪些网站是做包装的厦门seo网站优化
  • 深圳外包企业网站下载浏览器
  • 宁波网站优化方法十大网络营销经典案例
  • 做一晚水泥工歌曲网站潍坊seo招聘
  • 杭州住房建设部官方网站app推广注册从哪里接单
  • dede网站安装教程百度推广开户
  • 宿迁做网站的百度指数1000搜索量有多少
  • 佛山网站建设在哪windows优化大师好不好
  • 大型门户网站微信营销方案
  • 交互做的不好的网站sem推广外包
  • 数字人民币app开发公司西安百度seo推广
  • 今天猪价行情涨跌表今日猪价涨跌汕头seo不错
  • 百度手机模板网站中国域名注册官网
  • 安阳给商家做网站推广拼多多女装关键词排名