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

政府网站域名后缀谷歌优化是什么意思

政府网站域名后缀,谷歌优化是什么意思,手机软件开发外包,做影视剧组演员垂直平台网站力扣题-12.2 [力扣刷题攻略] Re:从零开始的力扣刷题生活 力扣题1:423. 从英文中重建数字 解题思想:有的单词通过一个字母就可以确定,依次确定即可 class Solution(object):def originalDigits(self, s):""":typ…

力扣题-12.2

[力扣刷题攻略] Re:从零开始的力扣刷题生活

力扣题1:423. 从英文中重建数字

解题思想:有的单词通过一个字母就可以确定,依次确定即可

在这里插入图片描述

class Solution(object):def originalDigits(self, s):""":type s: str:rtype: str"""char_count = {}t = 'egfihonsrutwvxz'for i in range(len(t)):char_count[t[i]] = 0for i in range(len(s)):if s[i] in char_count:char_count[s[i]] += 1else:char_count[s[i]] = 1result = []if char_count['z']!=0:for i in range(char_count['z']):result.append(0)temp = 'zero'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['x']!=0:for i in range(char_count['x']):result.append(6)temp = 'six'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['w']!=0:for i in range(char_count['w']):result.append(2)temp = 'two'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['g']!=0:for i in range(char_count['g']):result.append(8)temp = 'eight'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['s']!=0:for i in range(char_count['s']):result.append(7)temp = 'seven'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['h']!=0:for i in range(char_count['h']):result.append(3)temp = 'three'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['v']!=0:for i in range(char_count['v']):result.append(5)temp = 'five'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['f']!=0:for i in range(char_count['f']):result.append(4)temp = 'four'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['o']!=0:for i in range(char_count['o']):result.append(1)temp = 'one'for i in range(len(temp)):char_count[temp[i]] -=1if char_count['i']!=0:for i in range(char_count['i']):result.append(9)temp = 'nine'for i in range(len(temp)):char_count[temp[i]] -=1return ''.join(map(str, sorted(result)))
class Solution {
public:std::string originalDigits(std::string s) {std::unordered_map<char, int> charCount;std::string t = "egfihonsrutwvxz";for (char c : t) {charCount[c] = 0;}for (char c : s) {if (charCount.find(c) != charCount.end()) {charCount[c] += 1;}}std::vector<int> result;if (charCount['z'] != 0) {int count = charCount['z'];for (int i = 0; i < count; ++i) {result.push_back(0);std::string temp = "zero";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['x'] != 0) {int count = charCount['x'];for (int i = 0; i < count; ++i) {result.push_back(6);std::string temp = "six";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['w'] != 0) {int count = charCount['w'];for (int i = 0; i < count; ++i) {result.push_back(2);std::string temp = "two";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['g'] != 0) {int count = charCount['g'];for (int i = 0; i < count; ++i) {result.push_back(8);std::string temp = "eight";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['s'] != 0) {int count = charCount['s'];for (int i = 0; i < count; ++i) {result.push_back(7);std::string temp = "seven";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['h'] != 0) {int count = charCount['h'];for (int i = 0; i < count; ++i) {result.push_back(3);std::string temp = "three";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['v'] != 0) {int count = charCount['v'];for (int i = 0; i < count; ++i) {result.push_back(5);std::string temp = "five";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['f'] != 0) {int count = charCount['f'];for (int i = 0; i < count; ++i) {result.push_back(4);std::string temp = "four";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['o'] != 0) {int count = charCount['o'];for (int i = 0; i < count; ++i) {result.push_back(1);std::string temp = "one";for (char c : temp) {charCount[c] -= 1;}}}if (charCount['i'] != 0) {int count = charCount['i'];for (int i = 0; i < count; ++i) {result.push_back(9);std::string temp = "nine";for (char c : temp) {charCount[c] -= 1;}}}std::sort(result.begin(), result.end());std::string resultString;for (int digit : result) {resultString += std::to_string(digit);}return resultString;}
};
http://www.hrbkazy.com/news/39750.html

相关文章:

  • 和创客贴类似的网站出词
  • 唐山制作手机网站百度网址大全官方下载
  • 企业手机网站设计网站如何进行网络推广
  • 做外贸网站包括哪些网站建设seo
  • 福州移动网站建设排行榜前十名
  • 做数据新闻的网站有哪些方面百度seo关键词工具
  • jsp做的网站sem和seo的关系
  • 网站开发台州网络优化公司哪家好
  • 找网络公司做网站需要注意什么社群营销的十大步骤
  • 做本地网站能赚钱么百度下载app下载安装
  • 如何将自己做的网站放到网上去seo博客优化
  • 怎么用代码做网站合肥百度推广优化
  • 泉州高端模板建站关键词排名优化软件价格
  • 深圳网站建设服务提供商培训总结精辟句子
  • 提升网站安全临沂做网站建设公司
  • logo设计在线生成免费免费百度软件优化排名
  • 网站制作小图标腾讯企点怎么注册
  • 百度怎么在视频下方投放广告seo推广营销公司
  • 太平洋电脑网站西青seo
  • 公司企业文化模板seo域名综合查询
  • 一级a做爰片免费网站国产关键词广告
  • 动态网站开发案例精选上海关键词优化排名哪家好
  • vs2013 做网站免费网站提交入口
  • 南昌企业网站排名优化广州网络推广定制
  • 长沙房地产管理局seo草根博客
  • 佛山网站推广 优帮云比较好的网站建设网站
  • wordpress个人下载网站新浪微博指数查询
  • 模板网站可以做备案吗网站seo软件
  • 做垂直行业网站利润分析企业seo关键字优化
  • 同性男做的视频网站广告接单平台有哪些