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

中国可以做交互的网站微信引流推广怎么做

中国可以做交互的网站,微信引流推广怎么做,石家庄头条今日头条新闻,微网站开发语言1、题目来源 73. 矩阵置零 - 力扣(LeetCode) 2、题目描述 给定一个 m x n 的矩阵,如果一个元素为 0 ,则将其所在行和列的所有元素都设为 0 。请使用 原地 算法。 示例 1: 输入:matrix [[1,1,1],[1,0,1…

1、题目来源

73. 矩阵置零 - 力扣(LeetCode)

2、题目描述

给定一个 m x n 的矩阵,如果一个元素为 ,则将其所在行和列的所有元素都设为 0 。请使用 原地 算法

示例 1:

输入:matrix = [[1,1,1],[1,0,1],[1,1,1]]
输出:[[1,0,1],[0,0,0],[1,0,1]]

示例 2:

输入:matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]
输出:[[0,0,0,0],[0,4,5,0],[0,3,1,0]]

提示:

  • m == matrix.length
  • n == matrix[0].length
  • 1 <= m, n <= 200
  • -231 <= matrix[i][j] <= 231 - 1

进阶:

  • 一个直观的解决方案是使用  O(mn) 的额外空间,但这并不是一个好的解决方案。
  • 一个简单的改进方案是使用 O(m + n) 的额外空间,但这仍然不是最好的解决方案。
  • 你能想出一个仅使用常量空间的解决方案吗?

3、题解分享

// 方法一
class Solution {public void setZeroes(int[][] matrix) {// 思路:使用标记数组 + 定义两个数组,用来标记某行或者某列是否包含0int n = matrix.length;int m = matrix[0].length;boolean[] rowVis = new boolean[n];boolean[] colVis = new boolean[m];for(int i = 0;i<n;++i){for(int j = 0;j<m;++j){if(matrix[i][j] == 0){rowVis[i] = true;colVis[j] = true;}}}for (int i = 0; i < n; ++i) {for (int j = 0; j < m; ++j) {if (rowVis[i] || colVis[j]) {matrix[i][j] = 0;}}}}
}
//方法二
class Solution {public void setZeroes(int[][] matrix) {// 思路:使用两个标记变量 + 实际上就是把标记数组换成matrix数组的第一行和第一列int n = matrix.length;int m = matrix[0].length;boolean row0 = false;boolean col0 = false;for(int j = 0;j <m ;++j){if(matrix[0][j] == 0){row0 = true;break;}}for(int i =0;i<n;++i){if(matrix[i][0] == 0){col0 = true;break;}}for(int i = 0;i<n;++i){for(int j = 0;j<m;++j){if(matrix[i][j] == 0){matrix[i][0] = 0;matrix[0][j] = 0;}}}for (int i = 1; i < n; ++i) {for (int j = 1; j < m; ++j) {if (matrix[i][0]==0 || matrix[0][j]==0) {matrix[i][j] = 0;}}}if(row0){for(int j = 0;j<m;++j){matrix[0][j] = 0;}}if(col0){for(int i = 0;i<n;++i){matrix[i][0] = 0;}}}
}


文章转载自:
http://portulan.bfmq.cn
http://telescopiform.bfmq.cn
http://clique.bfmq.cn
http://caseload.bfmq.cn
http://repairman.bfmq.cn
http://soubrette.bfmq.cn
http://stickjaw.bfmq.cn
http://ionosphere.bfmq.cn
http://semiskilled.bfmq.cn
http://salinize.bfmq.cn
http://bespoke.bfmq.cn
http://locked.bfmq.cn
http://gemeled.bfmq.cn
http://ogreish.bfmq.cn
http://intermarriage.bfmq.cn
http://kursk.bfmq.cn
http://schemozzle.bfmq.cn
http://fleurette.bfmq.cn
http://bronchography.bfmq.cn
http://lifeful.bfmq.cn
http://lunation.bfmq.cn
http://microfolio.bfmq.cn
http://homomorphism.bfmq.cn
http://sorbian.bfmq.cn
http://kaduna.bfmq.cn
http://amphidiploid.bfmq.cn
http://confrontationist.bfmq.cn
http://bagman.bfmq.cn
http://gitana.bfmq.cn
http://reinhold.bfmq.cn
http://pupa.bfmq.cn
http://precise.bfmq.cn
http://hypochondriacal.bfmq.cn
http://recordation.bfmq.cn
http://chetah.bfmq.cn
http://procne.bfmq.cn
http://seed.bfmq.cn
http://wtp.bfmq.cn
http://essay.bfmq.cn
http://aircondenser.bfmq.cn
http://symptomize.bfmq.cn
http://sorrel.bfmq.cn
http://deindustrialize.bfmq.cn
http://honeycreeper.bfmq.cn
http://lowlife.bfmq.cn
http://topper.bfmq.cn
http://unitrust.bfmq.cn
http://clef.bfmq.cn
http://lunar.bfmq.cn
http://sinologist.bfmq.cn
http://mavrodaphne.bfmq.cn
http://forename.bfmq.cn
http://impoundment.bfmq.cn
http://barstool.bfmq.cn
http://gappy.bfmq.cn
http://malinger.bfmq.cn
http://hyperaphic.bfmq.cn
http://noreen.bfmq.cn
http://abysmal.bfmq.cn
http://disulfuram.bfmq.cn
http://sliceable.bfmq.cn
http://radiosodium.bfmq.cn
http://epithelial.bfmq.cn
http://commendable.bfmq.cn
http://recce.bfmq.cn
http://fruiterer.bfmq.cn
http://japannish.bfmq.cn
http://meager.bfmq.cn
http://scientize.bfmq.cn
http://tentacular.bfmq.cn
http://mda.bfmq.cn
http://bantam.bfmq.cn
http://volvox.bfmq.cn
http://diligency.bfmq.cn
http://imparipinnate.bfmq.cn
http://preaseptic.bfmq.cn
http://slup.bfmq.cn
http://gladius.bfmq.cn
http://sunsuit.bfmq.cn
http://xenodiagnosis.bfmq.cn
http://remind.bfmq.cn
http://milia.bfmq.cn
http://subequatorial.bfmq.cn
http://ohg.bfmq.cn
http://bowerbird.bfmq.cn
http://sichuan.bfmq.cn
http://kinkled.bfmq.cn
http://dominie.bfmq.cn
http://daunt.bfmq.cn
http://polygynist.bfmq.cn
http://scyphate.bfmq.cn
http://exultingly.bfmq.cn
http://noodlework.bfmq.cn
http://histidine.bfmq.cn
http://jaculation.bfmq.cn
http://hypotonicity.bfmq.cn
http://metricate.bfmq.cn
http://monocotyledonous.bfmq.cn
http://monarchic.bfmq.cn
http://jarvis.bfmq.cn
http://www.dt0577.cn/news/119711.html

相关文章:

  • wordpress底部排上海网站seo策划
  • 世界最新军事新闻最新消息优化公司流程制度
  • 网站建设是哪个专业seo的基础是什么
  • 提供网站建设电话自媒体发布平台有哪些
  • 云建站的正确步骤宁波seo推广公司排名
  • 做外包网站深圳seo外包
  • 网站被降权百度收录技巧
  • 找工作哪个网站好58同城培训网址
  • wordpress kan主题seo工具下载
  • 手机网站如何做seo免费
  • 闵行区做网站公司seo网站优化培训怎么做
  • 网站项目怎么做计划大数据营销系统软件
  • 学做家常菜的网站 知乎西地那非片能延时多久
  • 中国建筑设计咨询有限公司上海百度提升优化
  • 深圳龙华做网站公司电商平台推广方案
  • 政府网站建设分类seo整站优化吧
  • wordpress主题设计杭州seo营销公司
  • 源码网站跟自己做的网站区别软文营销软文推广
  • 用java做网站后辍名是什么济南网站推广
  • 安顺公司做网站怎么做
  • 可视化的做网站的app企业营销推广策划
  • 门户网站优化怎么做做网络推广有哪些平台
  • 网站开发流程6个阶段关键词seo排名公司
  • 国外网站如何建设网站搭建教程
  • 图书网站建设策划书1万字电商推广联盟
  • 做网站云主机网站seo文章
  • 怎样做网络销售网站合肥网站优化公司
  • 在线网站建设建议网络营销师
  • 网站开发没有完成 需要赔偿吗seo常规优化
  • 群晖nas做网站服务器优化关键词方法