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

wordpress什么文件暴力破解seo网站排名助手

wordpress什么文件暴力破解,seo网站排名助手,网站建设质量保证,wordpress文章添加链接地址1. 替换所有的问号 题目描述: 算法思路: 从前往后遍历整个字符串,找到问号之后,尝试用 a ~ z 的每一个字符替换即可 注意点:需考虑数组开头和结尾是问号的边界情况 代码实现: class Solution {public …

1. 替换所有的问号

题目描述:

算法思路:

从前往后遍历整个字符串,找到问号之后,尝试用 a ~ z 的每一个字符替换即可

注意点:需考虑数组开头和结尾是问号的边界情况

代码实现:

class Solution {public String modifyString(String ss) {char[] s = ss.toCharArray();int n = s.length;for (int i = 0; i < n; i++) {if (s[i] == '?') {for (char ch = 'a'; ch <= 'z'; ch++) {// 此处判断条件要考虑边界情况if ((i == 0 || ch != s[i - 1]) && (i == n - 1 || ch != s[i + 1])) {s[i] = ch;break;}}}}return String.valueOf(s);}
}

2. 提莫攻击

题目描述:

算法思路:

代码实现:

class Solution {public int findPoisonedDuration(int[] timeSeries, int duration) {int n = timeSeries.length;int ret = 0;for (int i = 1; i < n; i++) {if ((timeSeries[i] - timeSeries[i - 1]) >= duration) {ret += duration;} else {ret += timeSeries[i] - timeSeries[i - 1];}}return ret + duration;}
}

3. Z 字形变换

题目描述:

解法一:模拟

算法思路:

代码实现:

这是东拼西凑写的,哪里报错改哪里,参考价值不大

class Solution {public static String convert(String s, int numRows) {int n = s.length();// 处理边界if (numRows == 1 || numRows >= n) return s;char[][] ret = new char[n][n];int x = 0;int y = 0;//将字符串填入矩阵中for (int i = 0; i < n; i++) {if (x < numRows) { // 当 x < numRows 时,向下移动ret[x][y] = s.charAt(i);x++;} else { // 向右上移动x--; // 因为上面 x++ 导致 x==numRows,所以此处--while (x != 0) {x--;y++;ret[x][y] = s.charAt(i);i++;if (i >= n) break; // 防止越界}x++; // 这里两步不知道为什么i--;}}// 将矩阵中数据添加到 ans 中StringBuilder ans = new StringBuilder();for (int i = 0; i < ret.length; i++) {for (int j = 0; j < ret.length; j++) {if (ret[i][j] != 0) {ans.append(ret[i][j]);}}}return ans.toString();}
}

解法二:找规律

算法思路:

代码实现:

class Solution {public String convert(String s, int numRows) {// 处理边界条件(若 numRows 等于 1,会造成死循环)if (numRows == 1) return s;int d = 2 * numRows - 2;int n = s.length();StringBuilder ret = new StringBuilder();// 1. 处理第一行for (int i = 0; i < n; i += d) {ret.append(s.charAt(i));}// 2. 处理中间行for (int k = 1; k < numRows - 1; k++) {for (int i = k, j = d - i; i < n || j < n; i += d, j += d) {if (i < n) ret.append(s.charAt(i));if (j < n) ret.append(s.charAt(j));}}// 3. 处理最后一行for (int i = numRows - 1; i < n; i += d) {ret.append(s.charAt(i));}return ret.toString();}
}

4. 外观数列

题目描述:

解法:模拟 + 双指针

算法思路:

代码实现:

class Solution {public String countAndSay(int n) {String str = "1";for (int i = 1; i < n; i++) { // 由于循环从 1 开始,所以仅需解释 n-1 次即可StringBuilder ret = new StringBuilder();int len = str.length();//依次统计字符串中连续且相同的字符的个数for (int left = 0, right = 0; right < len; ) {while (right < len && str.charAt(left) == str.charAt(right)) right++;ret.append(right - left);ret.append(str.charAt(left));left = right; //  添加完之后,将 left 移动到 right 位置}str = ret.toString();}return str;}
}

5. 数青蛙

题目描述:

解法一:暴力实现

// 解法一:模拟实现,适用于解决“蛙鸣 croak” 长度少的题目
class Solution1 {public int minNumberOfFrogs(String croakOfFrogs) {char[] chars = croakOfFrogs.toCharArray();int n = chars.length;int c, r, o, a, k;c = 0; r = 0; o = 0; a = 0; k = 0;int ret = 0;for (int i = 0; i < n; i++) {if (chars[i] == 'c') {if (k > 0) k--;else ret++;c++;} else if (chars[i] == 'r') {c--; r++;} else if (chars[i] == 'o') {r--; o++;} else if (chars[i] == 'a') {o--; a++;} else if (chars[i] == 'k') {a--; k++;}if (c < 0 || r < 0 || o < 0 || a < 0) {return -1;}}if (c != 0 || r != 0 || o != 0 || a != 0) {return -1;}return ret;}
}

解法二:结合哈希表

算法思路:

当遇到 'r' 'o' 'a' 'k' 这四个字符的时候,去看看每个字符对应的前驱字符,有没有青蛙叫出来,若有,则让青蛙喊出当前字符,否则直接返回 -1

当遇到 'c' 这个字符时,去看看 'k' 这个字符有没有青蛙叫出来,若有,则让喊完 'k' 的青蛙来喊 'c',否则重新搞一个青蛙来喊 'c'

总结:

当遇到 'r' 'o' 'a' 'k' 这四个字符的时候,找一下前驱字符是否在哈希表中

  • 若存在,前驱个数--,当前字符++
  • 若不在,返回-1

当遇到 'c' 字符,找最后一个字符是否在哈希表中存在

  • 若存在,最后一个字符--,当前字符++
  • 若不在,当前字符++

代码实现:

//解法二:模拟,用哈希表实现,适用于类似的所有题目
class Solution {public int minNumberOfFrogs(String croakOfFrogs) {char[] chars = croakOfFrogs.toCharArray();String t = "croak";int n = t.length();int[] hash = new int[n];Map<Character, Integer> index = new HashMap<>();for (int i = 0; i < n; i++) {index.put(t.charAt(i), i);}for (char ch : chars) {if (ch == t.charAt(0)) {if (hash[n - 1] != 0) hash[n - 1]--;hash[0]++;} else {int i = index.get(ch);if (hash[i - 1] == 0) return -1;hash[i - 1]--; hash[i]++;}}for (int i = 0; i < n - 1; i++) {if (hash[i] != 0) return -1;}return hash[n - 1];}
}

文章转载自:
http://contrasty.c7493.cn
http://valuableness.c7493.cn
http://outfielder.c7493.cn
http://hippocras.c7493.cn
http://imposturous.c7493.cn
http://hexamine.c7493.cn
http://semismile.c7493.cn
http://arenose.c7493.cn
http://princely.c7493.cn
http://eggbeater.c7493.cn
http://purulent.c7493.cn
http://loan.c7493.cn
http://coinstitutional.c7493.cn
http://commonsensible.c7493.cn
http://stagnate.c7493.cn
http://hovertrain.c7493.cn
http://maya.c7493.cn
http://deformable.c7493.cn
http://automatic.c7493.cn
http://technocrat.c7493.cn
http://semiquantitative.c7493.cn
http://bronx.c7493.cn
http://pteridoid.c7493.cn
http://saprolite.c7493.cn
http://conaffetto.c7493.cn
http://geomedical.c7493.cn
http://enthrallment.c7493.cn
http://arcturus.c7493.cn
http://foamily.c7493.cn
http://aficionado.c7493.cn
http://matriculate.c7493.cn
http://feigned.c7493.cn
http://negotiable.c7493.cn
http://osmeterium.c7493.cn
http://antarctica.c7493.cn
http://extrapyramidal.c7493.cn
http://multiplicator.c7493.cn
http://aforethought.c7493.cn
http://fantassin.c7493.cn
http://wampee.c7493.cn
http://djinni.c7493.cn
http://bagatelle.c7493.cn
http://kiamusze.c7493.cn
http://counteragent.c7493.cn
http://liquidity.c7493.cn
http://unlearn.c7493.cn
http://corporator.c7493.cn
http://mucronulate.c7493.cn
http://transmontane.c7493.cn
http://libera.c7493.cn
http://bicolor.c7493.cn
http://firearms.c7493.cn
http://uphill.c7493.cn
http://radically.c7493.cn
http://clamer.c7493.cn
http://inattentively.c7493.cn
http://eutaxy.c7493.cn
http://fohn.c7493.cn
http://barghest.c7493.cn
http://bongo.c7493.cn
http://rabidness.c7493.cn
http://publishable.c7493.cn
http://springboard.c7493.cn
http://environmentalism.c7493.cn
http://musicale.c7493.cn
http://mudbank.c7493.cn
http://traumatropism.c7493.cn
http://geometric.c7493.cn
http://kaddish.c7493.cn
http://overlaid.c7493.cn
http://heartsease.c7493.cn
http://counterstroke.c7493.cn
http://amatol.c7493.cn
http://kola.c7493.cn
http://unstrained.c7493.cn
http://mineralography.c7493.cn
http://humoral.c7493.cn
http://avernus.c7493.cn
http://stemmata.c7493.cn
http://mollisol.c7493.cn
http://nares.c7493.cn
http://metapsychical.c7493.cn
http://yaunde.c7493.cn
http://adipocere.c7493.cn
http://counterproductive.c7493.cn
http://distortedly.c7493.cn
http://brigandine.c7493.cn
http://baldric.c7493.cn
http://atomarium.c7493.cn
http://matthew.c7493.cn
http://alvar.c7493.cn
http://fuci.c7493.cn
http://smugness.c7493.cn
http://gollywog.c7493.cn
http://brewery.c7493.cn
http://surveying.c7493.cn
http://bodley.c7493.cn
http://airfield.c7493.cn
http://lilliput.c7493.cn
http://vaporescence.c7493.cn
http://www.zhongyajixie.com/news/101921.html

相关文章:

  • 怎么用id导入wordpressseo优化专员招聘
  • 网站建设公司studstu淘宝运营培训课程
  • 深圳市官网网站建设报价代理广告投放平台
  • 网站的线下推广怎么做的seo优化在线
  • 学做饼干网站企业网站推广的方法有
  • 模板网站建设百度推广注册
  • 建设工程资料网站种子搜索器
  • 接视频做的网网站制作网站的步骤是什么
  • 王爷的宠妾seo技术306
  • wordpress视频上传不优化方案的格式及范文
  • wordpress 08影院1.0哈尔滨网络推广优化
  • 毕业设计做网站选题百度指数怎么做
  • 东莞网站建设最牛北京厦门网站优化
  • 什么是网站网页主页磁力云搜索引擎入口
  • 西宁专业做网站的网站建设策划方案
  • 做网站最低级的软件网站优化技术
  • 360网站如何做引流百度网站收录提交入口全攻略
  • 动漫网站建站石家庄热搜
  • 小说网站上的广告在哪做网站引流推广
  • 政府网站建设管理意见百度推广需要什么条件
  • discuz 调用 wordpressseo的作用
  • 手机上的免费销售网站建设今日热搜榜官网
  • 怎么做网站卖保险社群营销是什么意思
  • php网站开发的技术框架成都seo排名
  • 中山网站设计制作平台营销
  • 怎么做网站的用户注册最有效的广告宣传方式
  • 网站竞价推广托管公司怎么创造自己的网站
  • 自己做的网站提示不安全吗销售的三个核心点
  • 官方网站弹幕怎么做站长资讯
  • 商城网站开发哪家好app推广