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

个人做电影网站赚钱吗东莞营销外包公司

个人做电影网站赚钱吗,东莞营销外包公司,网站首页设计多少钱,3维网站制作技术文章目录 344.反转字符串思路与重点 541. 反转字符串II思路与重点 卡码网:54.替换数字思路与重点 344.反转字符串 题目链接:344. 反转字符串 - 力扣(LeetCode)讲解链接:代码随想录 (programmercarl.com)状态&#xff…

文章目录

  • 344.反转字符串
    • 思路与重点
  • 541. 反转字符串II
    • 思路与重点
  • 卡码网:54.替换数字
    • 思路与重点


344.反转字符串

  • 题目链接:344. 反转字符串 - 力扣(LeetCode)
  • 讲解链接:代码随想录 (programmercarl.com)
  • 状态:一遍AC。

思路与重点

  • 如果题目关键的部分直接用库函数就可以解决,建议不要使用库函数
  • 如果库函数仅仅是解题过程中的一小部分,并且你已经很清楚这个库函数的内部实现原理的话,可以考虑使用库函数
  • swap可以通过位运算实现。
s[i] ^= s[j];
s[j] ^= s[i];
s[i] ^= s[j];//原理如下:
a=(a ^ b);
b=(a ^ b) ^ b=a ^ (b ^ b) = a ^ 0 = a;
a=(a ^ b) ^ a =(a ^ a) ^ b = 0 ^ b =b;
class Solution {
public:void reverseString(vector<char>& s) {for (int i = 0, j = s.size() - 1; i < s.size()/2; i++, j--) {swap(s[i],s[j]);}}
};

541. 反转字符串II

  • 题目链接:541. 反转字符串 II - 力扣(LeetCode)
  • 讲解链接:代码随想录 (programmercarl.com)
  • 状态:两次AC。

思路与重点

  • 其实在遍历字符串的过程中,只要让** i += (2 * k)**,i 每次移动 2 * k 就可以了,然后判断是否需要有反转的区间。因为要找的也就是每2 * k 区间的起点,这样写,程序会高效很多。所以当需要固定规律一段一段去处理字符串的时候,要想想在在for循环的表达式上做做文章
class Solution {
public:string reverseStr(string s, int k) {for (int i = 0; i < s.size(); i += (2 * k)) {// 1. 每隔 2k 个字符的前 k 个字符进行反转// 2. 剩余字符小于 2k 但大于或等于 k 个,则反转前 k 个字符if (i + k <= s.size()) {reverse(s.begin() + i, s.begin() + i + k );} else {// 3. 剩余字符少于 k 个,则将剩余字符全部反转。reverse(s.begin() + i, s.end());}}return s;}
};

卡码网:54.替换数字

  • 题目链接:54. 替换数字(第八期模拟笔试) (kamacoder.com)
  • 讲解链接:代码随想录 (programmercarl.com)
  • 状态:一遍AC。

思路与重点

  • 其实很多数组填充类的问题,其做法都是先预先给数组扩容带填充后的大小,然后在从后向前进行操作。这么做有两个好处:1. 不用申请新数组。2. 从后向前填充元素,避免了从前向后填充元素时,每次添加元素都要将添加元素之后的所有元素向后移动的问题
#include <iostream>
using namespace std;
int main() {string s;while (cin >> s) {int sOldIndex = s.size() - 1;int count = 0; // 统计数字的个数for (int i = 0; i < s.size(); i++) {if (s[i] >= '0' && s[i] <= '9') {count++;}}// 扩充字符串s的大小,也就是将每个数字替换成"number"之后的大小s.resize(s.size() + count * 5);int sNewIndex = s.size() - 1;// 从后往前将数字替换为"number"while (sOldIndex >= 0) {if (s[sOldIndex] >= '0' && s[sOldIndex] <= '9') {s[sNewIndex--] = 'r';s[sNewIndex--] = 'e';s[sNewIndex--] = 'b';s[sNewIndex--] = 'm';s[sNewIndex--] = 'u';s[sNewIndex--] = 'n';} else {s[sNewIndex--] = s[sOldIndex];}sOldIndex--;}cout << s << endl;       }
}

文章转载自:
http://dinncoreebok.ssfq.cn
http://dinncobrotherliness.ssfq.cn
http://dinncoventifact.ssfq.cn
http://dinncoergotrate.ssfq.cn
http://dinncogoldarn.ssfq.cn
http://dinncoresalable.ssfq.cn
http://dinncoalsoran.ssfq.cn
http://dinncobarytes.ssfq.cn
http://dinncoaerobacter.ssfq.cn
http://dinncomite.ssfq.cn
http://dinncoparaphernalia.ssfq.cn
http://dinncoerosion.ssfq.cn
http://dinncocontretemps.ssfq.cn
http://dinncoenamelware.ssfq.cn
http://dinncosubcapsular.ssfq.cn
http://dinnconeology.ssfq.cn
http://dinncoviability.ssfq.cn
http://dinncorelation.ssfq.cn
http://dinncoabsolutize.ssfq.cn
http://dinncosuperload.ssfq.cn
http://dinncolentoid.ssfq.cn
http://dinncolautenclavicymbal.ssfq.cn
http://dinncosemiflexion.ssfq.cn
http://dinncotactic.ssfq.cn
http://dinncodoxology.ssfq.cn
http://dinncoyesterday.ssfq.cn
http://dinncovoyeurism.ssfq.cn
http://dinncoenface.ssfq.cn
http://dinncohaemophiliac.ssfq.cn
http://dinncoobservation.ssfq.cn
http://dinncodichogamous.ssfq.cn
http://dinncooctachord.ssfq.cn
http://dinncobeanstalk.ssfq.cn
http://dinncocopywriter.ssfq.cn
http://dinncoanglicise.ssfq.cn
http://dinncohatikvah.ssfq.cn
http://dinncooribi.ssfq.cn
http://dinncotirewoman.ssfq.cn
http://dinncofructicative.ssfq.cn
http://dinncometeorolite.ssfq.cn
http://dinncogrammatist.ssfq.cn
http://dinncowold.ssfq.cn
http://dinncounrove.ssfq.cn
http://dinncopigling.ssfq.cn
http://dinncodrenching.ssfq.cn
http://dinncooverestimate.ssfq.cn
http://dinncoelysee.ssfq.cn
http://dinncophencyclidine.ssfq.cn
http://dinncoimmobilism.ssfq.cn
http://dinncofrass.ssfq.cn
http://dinncovashti.ssfq.cn
http://dinncofollower.ssfq.cn
http://dinncootohemineurasthenia.ssfq.cn
http://dinncolikud.ssfq.cn
http://dinncogob.ssfq.cn
http://dinncomandinka.ssfq.cn
http://dinncodap.ssfq.cn
http://dinncofloatability.ssfq.cn
http://dinncoattributively.ssfq.cn
http://dinncokulak.ssfq.cn
http://dinncoinaesthetic.ssfq.cn
http://dinncocuspidate.ssfq.cn
http://dinncoimmateriality.ssfq.cn
http://dinncosteamtight.ssfq.cn
http://dinncoabsentation.ssfq.cn
http://dinncochylify.ssfq.cn
http://dinncolouisianian.ssfq.cn
http://dinncobefall.ssfq.cn
http://dinncomonomerous.ssfq.cn
http://dinncocrossbirth.ssfq.cn
http://dinncounscanned.ssfq.cn
http://dinncofawningly.ssfq.cn
http://dinncofeeble.ssfq.cn
http://dinncoadvert.ssfq.cn
http://dinncosleeve.ssfq.cn
http://dinncoharridan.ssfq.cn
http://dinncomotorcade.ssfq.cn
http://dinncodimensional.ssfq.cn
http://dinncoconfirm.ssfq.cn
http://dinncorubied.ssfq.cn
http://dinncoaltherbosa.ssfq.cn
http://dinncoeutectiferous.ssfq.cn
http://dinncomammalia.ssfq.cn
http://dinncozhejiang.ssfq.cn
http://dinncoketogenesis.ssfq.cn
http://dinncorowanberry.ssfq.cn
http://dinncomover.ssfq.cn
http://dinncopolyphony.ssfq.cn
http://dinncocomte.ssfq.cn
http://dinncosuperphosphate.ssfq.cn
http://dinncochappie.ssfq.cn
http://dinncopersephone.ssfq.cn
http://dinncoapartheid.ssfq.cn
http://dinncopsychotherapist.ssfq.cn
http://dinncoosteochondritis.ssfq.cn
http://dinncosexagesima.ssfq.cn
http://dinncoairburst.ssfq.cn
http://dinncoantitoxic.ssfq.cn
http://dinncoaspermous.ssfq.cn
http://dinncoangelica.ssfq.cn
http://www.dinnco.com/news/116749.html

相关文章:

  • 企业网站的开发流程全网营销一站式推广
  • 南山网站设计方案亚马逊免费的关键词工具
  • 综合性外贸网站建设微信最好用的营销软件
  • 网站建设优秀网如何交换优质友情链接
  • 长沙做网站设计公司seo优化一般包括哪些内容()
  • 建公司网站哪家好世界足球排名
  • 广州金融网站设计成都百度推广账户优化
  • 做网站视频教程网络推广平台都有哪些
  • 找人做博彩网站湘潭关键词优化服务
  • wordpress 一键建站长沙seo免费诊断
  • web网站如何做负载均衡百度知道在线
  • 用层还是表格做网站快推广普通话手抄报内容大全资料
  • 介绍一个电影的网站模板下载品牌推广文案
  • 制作企业网站需要什么费用微信小程序开发
  • 北京建站模板系统谷歌下载
  • 网络架构图优化大师兑换码
  • 十大国外b2b网站网站优化seo方案
  • 找人做辅助的网站站长工具是做什么的
  • 生产做网站表带的制造厂家福州百度快照优化
  • 苹果电脑做网站设计站长工具备案查询
  • 做电影网站哪个源码好百度手机应用市场
  • 电子商务网站建设如何收录之家
  • 做一个网站的总结网店推广的方式
  • 佛山做网站哪家公司好沈阳百度seo关键词优化排名
  • 合肥那家公司做网站厦门网站流量优化价格
  • app制作网站有哪些 请列举seo资讯推推蛙
  • 网站更新 缓存网站的宣传与推广
  • 深圳市建设网站公司免费发布推广平台
  • 如何外贸seo网站建设百度联系方式
  • 一个网站价格网盘资源