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

门户网站如何推广南宁seo网站排名优化公司

门户网站如何推广,南宁seo网站排名优化公司,如何修改网站后台地址,医疗器械公司简介力扣题-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.zhongyajixie.com/news/228.html

相关文章:

  • wordpress中文开发电子书深圳网站优化
  • 用jsp怎么做的购物网站竞价托管哪家便宜
  • 玉环市建设工程检测中心网站网站流量统计系统
  • 做php网站会员开店代码如何编写英文谷歌seo
  • 网站多个页面要加引导目前最火的推广平台
  • 1有免费建网站能让网络非常流畅的软件
  • 静态网站建设淘宝seo具体优化方法
  • fiverr找人做网站靠谱吗灰色行业怎么推广引流
  • 企业文化展厅设计方案排名优化外包公司
  • 网站突然暴增流量网络营销的新特点
  • 做网站的怎么学网络营销推广方案策划与实施
  • 利用淘宝视频服务做视频网站网络推广的主要内容
  • 网站需要多少钱西安网络公司
  • 做网站和做app哪个难google play下载安装
  • 目前做啥网站能致富站长工具爱站网
  • 百度一直不收录网站网站推广策略
  • 免费聊天网站模板和源码少儿培训
  • 番禺网站建设外包免费seo工具
  • 绵阳的网站建设公司百度移动排名优化软件
  • 网站跳转是什么意思2022小说排行榜百度风云榜
  • 网站建设发展现状淘宝补流量平台
  • 办公空间设计布局如何进行网站性能优化
  • 本地拖拽网站建设百度快速收录seo工具软件
  • 暴雪国服官网入口seo云优化软件
  • 广州网站建设类岗位seo百度seo排名优化软件
  • 男科医院网站建设网店运营工资一般多少
  • 高端网站建设公司排行2020国内十大小说网站排名
  • 技术支持 东莞网站建设机械加工湖南疫情最新消息
  • 网站静态化怎么做永久免费国外域名注册
  • 来年做哪些网站能致富百度推广排名怎么做的