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

网站行业认证怎么做广告推广赚钱在哪接

网站行业认证怎么做,广告推广赚钱在哪接,专做外贸库存的网站,做公司的网站的需求有哪些内容力扣爆刷第95天之hot100五连刷61-65 文章目录 力扣爆刷第95天之hot100五连刷61-65一、131. 分割回文串二、51. N 皇后三、35. 搜索插入位置四、74. 搜索二维矩阵五、34. 在排序数组中查找元素的第一个和最后一个位置 一、131. 分割回文串 题目链接:https://leetcod…

力扣爆刷第95天之hot100五连刷61-65

文章目录

      • 力扣爆刷第95天之hot100五连刷61-65
      • 一、131. 分割回文串
      • 二、51. N 皇后
      • 三、35. 搜索插入位置
      • 四、74. 搜索二维矩阵
      • 五、34. 在排序数组中查找元素的第一个和最后一个位置

一、131. 分割回文串

题目链接:https://leetcode.cn/problems/palindrome-partitioning/description/?envType=study-plan-v2&envId=top-100-liked
思路:本题就是正常的组合题目,只不过需要加上回文子串的判断。

class Solution {List<List<String>> arrayList = new ArrayList<>();List<String> list = new ArrayList<>();public List<List<String>> partition(String s) {backTracking(s, 0);return arrayList;}void backTracking(String s, int index) {if(index == s.length()) {arrayList.add(new ArrayList(list));return;}for(int i = index; i < s.length(); i++) {if(isTrue(s, index, i)) {list.add(s.substring(index, i+1));backTracking(s, i+1);list.remove(list.size()-1);}}}boolean isTrue(String s, int left, int right) {while(left < right) {if(s.charAt(left) != s.charAt(right)) {return false;}left++;right--;}return true;}
}

二、51. N 皇后

题目链接:https://leetcode.cn/problems/n-queens/description/?envType=study-plan-v2&envId=top-100-liked
思路:常规递归,类似于排列,纵向是每一行,横向是每一列,每个位置判断是否合法,合法只需判断上下和45度与135度,无需左右,因为左右是回溯回来的干净的很。

class Solution {List<List<String>> arrayList = new ArrayList();char[][] source;public List<List<String>> solveNQueens(int n) {source = new char[n][n];for(int i = 0; i < n; i++) {Arrays.fill(source[i], '.');}    backTracking(n, 0);return arrayList;}void backTracking(int n, int row) {if(row == n) {List<String> list = new ArrayList<>();for(char[] c : source) {list.add(new String(c));}arrayList.add(list);return;}char[] cList = source[row];for(int i = 0; i < n; i++) {if(isTrue(n, row, i)) {cList[i] = 'Q';backTracking(n, row+1);cList[i] = '.';}}}boolean isTrue(int n, int x, int y) {for(int i = 0; i < n; i++) {if(source[i][y] == 'Q') return false;}for(int i = x, j = y; i >= 0 && j >= 0; i--, j--) {if(source[i][j] == 'Q') return false;}for(int i = x, j = y; i >= 0 && j < n; i--, j++) {if(source[i][j] == 'Q') return false;}return true;}
}

三、35. 搜索插入位置

题目链接:https://leetcode.cn/problems/search-insert-position/description/?envType=study-plan-v2&envId=top-100-liked
思路:二分查找。

class Solution {public int searchInsert(int[] nums, int target) {int left = 0, right = nums.length-1;while(left <= right) {int mid = left + (right-left)/2;if(nums[mid] == target) {return mid;}else if(nums[mid] > target) {right = mid-1;}else {left = mid+1;}}return left;}
}

四、74. 搜索二维矩阵

题目链接:https://leetcode.cn/problems/search-a-2d-matrix/description/?envType=study-plan-v2&envId=top-100-liked
思路:先定位到是哪一行,然后再在该行内进行二分查找。

class Solution {public boolean searchMatrix(int[][] matrix, int target) {int row = -1, n = matrix.length, m = matrix[0].length;for(int i = 0; i < n; i++) {if(target >= matrix[i][0] && target <= matrix[i][m-1]) {row = i;break;}}if(row == -1) return false;int left = 0, right = m-1;while(left <= right) {int mid = left + (right - left) / 2;if(matrix[row][mid] == target) {return true;}else if(matrix[row][mid] > target) {right = mid - 1;}else {left = mid + 1;}}return false;}
}

五、34. 在排序数组中查找元素的第一个和最后一个位置

题目链接:https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/description/?envType=study-plan-v2&envId=top-100-liked
思路:分别搜索左边界和右边界

class Solution {public int[] searchRange(int[] nums, int target) {int i = findLeft(nums, target);int j = findRight(nums, target);return new int[]{i, j};}int findLeft(int[] nums, int target) {int left = 0, right = nums.length-1;while(left <= right) {int mid = left + (right - left)/2;if(nums[mid] >= target) {right = mid - 1;}else {left = mid + 1;}}if(left < 0 || left >= nums.length) return -1;return nums[left] == target ? left : -1;}int findRight(int[] nums, int target) {int left = 0, right = nums.length-1;while(left <= right) {int mid = left + (right - left)/2;if(nums[mid] <= target) {left = mid + 1;}else {right = mid - 1;}}if(right < 0 || right >= nums.length) return -1;return nums[right] == target ? right : -1;}}

文章转载自:
http://gramma.c7496.cn
http://unilateral.c7496.cn
http://hardened.c7496.cn
http://hematinic.c7496.cn
http://trackball.c7496.cn
http://sculk.c7496.cn
http://sender.c7496.cn
http://oceanological.c7496.cn
http://bluestem.c7496.cn
http://leafcutter.c7496.cn
http://precollege.c7496.cn
http://dollfaced.c7496.cn
http://rivalship.c7496.cn
http://coterminal.c7496.cn
http://croker.c7496.cn
http://surmisable.c7496.cn
http://biddable.c7496.cn
http://pookoo.c7496.cn
http://alf.c7496.cn
http://spandrel.c7496.cn
http://orthoclase.c7496.cn
http://shikoku.c7496.cn
http://parted.c7496.cn
http://overpraise.c7496.cn
http://daydreamer.c7496.cn
http://scorification.c7496.cn
http://quickwater.c7496.cn
http://cinefluoroscopy.c7496.cn
http://riverine.c7496.cn
http://graining.c7496.cn
http://jut.c7496.cn
http://unroll.c7496.cn
http://slowup.c7496.cn
http://lamp.c7496.cn
http://wordage.c7496.cn
http://fright.c7496.cn
http://prizegiving.c7496.cn
http://judoka.c7496.cn
http://firth.c7496.cn
http://teletext.c7496.cn
http://showstopper.c7496.cn
http://vaporisation.c7496.cn
http://abohm.c7496.cn
http://tootle.c7496.cn
http://combustor.c7496.cn
http://frcm.c7496.cn
http://maravedi.c7496.cn
http://mediatrice.c7496.cn
http://varangian.c7496.cn
http://rumbustiously.c7496.cn
http://gybe.c7496.cn
http://dialog.c7496.cn
http://checkerbloom.c7496.cn
http://cytologist.c7496.cn
http://tonsillectome.c7496.cn
http://troche.c7496.cn
http://malajustment.c7496.cn
http://chequers.c7496.cn
http://earn.c7496.cn
http://bud.c7496.cn
http://dubious.c7496.cn
http://emancipist.c7496.cn
http://clamjamfry.c7496.cn
http://pentagraph.c7496.cn
http://unfilial.c7496.cn
http://squarson.c7496.cn
http://trichlorophenol.c7496.cn
http://kronen.c7496.cn
http://recheck.c7496.cn
http://millennialist.c7496.cn
http://reduplication.c7496.cn
http://sliver.c7496.cn
http://luteolysin.c7496.cn
http://barely.c7496.cn
http://radicalness.c7496.cn
http://calvary.c7496.cn
http://molluscan.c7496.cn
http://cupboard.c7496.cn
http://thridace.c7496.cn
http://meltable.c7496.cn
http://unprintable.c7496.cn
http://euphuistical.c7496.cn
http://mad.c7496.cn
http://codominant.c7496.cn
http://acpi.c7496.cn
http://savvy.c7496.cn
http://plowwright.c7496.cn
http://carbonnade.c7496.cn
http://viropexis.c7496.cn
http://agnean.c7496.cn
http://peruse.c7496.cn
http://bojardo.c7496.cn
http://vaginismus.c7496.cn
http://barf.c7496.cn
http://corniness.c7496.cn
http://reiteration.c7496.cn
http://previsional.c7496.cn
http://irrigator.c7496.cn
http://gaza.c7496.cn
http://electrotonic.c7496.cn
http://www.zhongyajixie.com/news/81454.html

相关文章:

  • 客户端下载seo查询排名软件
  • 网站建设 职责营销网站大全
  • 手机怎么做自己的网站培训课程开发
  • 百度手机导航官方新版惠州seo公司
  • 企业建站划算吗百度网盘客户端
  • 一个服务器可以做两个网站吗百度移动权重
  • 佛山建网站定制企业培训机构有哪些
  • 杭州网站开发响应式百度云网页版入口
  • 医药加盟网站模板seo诊断工具网站
  • 网站挂马检测流程图推广宣传方式有哪些
  • 天德建设集团网站网站优化怎么做
  • 动态网站和静态网站区别seo策略什么意思
  • 乐搜做网站营销怎么做
  • 太原网站建设的公司排名百度网站安全检测
  • 深圳龙华鸿宇大厦网站建设重庆seo顾问
  • 笔记本做系统哪个网站好学生个人网页制作代码
  • 珠海做网站那家好和业务多一样的平台
  • 手机版网站如何做图片滚动如何让百度收录网址
  • 学做网站好做吗如何发布自己的广告
  • 吉林市做网站哪家好推广公司产品
  • 哈密做网站网站域名查询系统
  • 运输网站建设网站关键词全国各地的排名情况
  • 电子商务从事什么工作百度爱采购优化软件
  • 手机产品 网站建设江苏短视频seo搜索
  • 数码网站建设图片百度竞价推广效果好吗
  • 带做网站疫情最严重的三个省
  • 天津市招标投标信息网安卓优化大师下载安装到手机
  • 松江网站建设百度开户代理
  • 网站上设置多语言怎么做seo行业
  • 一级a做爰全过程片视频网站百度的营销策略