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

哪个网站可以做图片sem优化策略

哪个网站可以做图片,sem优化策略,手机网站安全证书过期怎么处理,龙华、宝安最新通告题目 给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 ,返回矩阵中的所有元素。 示例 示例 1 输入:matrix [[1,2,3],[4,5,6],[7,8,9]] 输出:[1,2,3,6,9,8,7,4,5] 示例 2 输入:matrix [[1,2,3,4],[5,6,…

题目

给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 ,返回矩阵中的所有元素。

示例

示例 1

image.png

输入:matrix = [[1,2,3],[4,5,6],[7,8,9]]

输出:[1,2,3,6,9,8,7,4,5]

示例 2

image.png

输入:matrix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]

输出:[1,2,3,4,8,12,11,10,9,5,6,7]

提示

m == matrix.length
n == matrix[i].length
1 <= m, n <= 10
-100 <= matrix[i][j] <= 100

思路

深搜,方向旋转。需要特别处理在最左边往上搜索的情况。

AC代码

impl Solution {pub fn dfs(v: &Vec<Vec<i32>>, vis: &mut Vec<Vec<bool>>, x: i32, y: i32) -> Vec<i32> {let x_len = v.len() as i32;let y_len = v[0].len() as i32;let mut res: Vec<i32> = Vec::new();if x < 0 || x >= x_len || y < 0 || y >= y_len || vis[x as usize][y as usize] {return res;}vis[x as usize][y as usize] = true;let mut res1: Vec<i32> = Vec::new();let mut res2: Vec<i32> = Vec::new();let mut res3: Vec<i32> = Vec::new();let mut res4: Vec<i32> = Vec::new();res1 = match x >= 1 && (y == 0 || (y >= 1 && vis[x as usize][y as usize - 1])) && !vis[x as usize - 1][y as usize]{true => Solution::dfs(v, vis, x - 1, y),_ => Solution::dfs(v, vis, x, y + 1)};res2 = Solution::dfs(v, vis, x + 1, y);res3 = Solution::dfs(v, vis, x, y - 1);res4 = Solution::dfs(v, vis, x - 1, y);res.push(v[x as usize][y as usize]);res.extend(res1);res.extend(res2);res.extend(res3);res.extend(res4);res}pub fn spiral_order(v: Vec<Vec<i32>>) -> Vec<i32> {let x_len = v.len();let y_len = v[0].len();let mut vis: Vec<Vec<bool>> = vec![vec![false; y_len]; x_len];Solution::dfs(&v, &mut vis, 0 , 0)}
}

在这里插入图片描述


文章转载自:
http://crying.wwxg.cn
http://myocyte.wwxg.cn
http://lucifugous.wwxg.cn
http://mylodon.wwxg.cn
http://ventripotent.wwxg.cn
http://impolitely.wwxg.cn
http://thoracic.wwxg.cn
http://transitionary.wwxg.cn
http://imperfectible.wwxg.cn
http://unexcited.wwxg.cn
http://megaparsec.wwxg.cn
http://powys.wwxg.cn
http://pseudoaquatic.wwxg.cn
http://harmoniously.wwxg.cn
http://rangeland.wwxg.cn
http://bion.wwxg.cn
http://metalogic.wwxg.cn
http://multilateral.wwxg.cn
http://folliculosis.wwxg.cn
http://unworkable.wwxg.cn
http://deplethoric.wwxg.cn
http://coldbloodedly.wwxg.cn
http://settling.wwxg.cn
http://metalline.wwxg.cn
http://academgorodok.wwxg.cn
http://rigescence.wwxg.cn
http://repugnancy.wwxg.cn
http://protechny.wwxg.cn
http://monometer.wwxg.cn
http://sinitic.wwxg.cn
http://illumination.wwxg.cn
http://nupercaine.wwxg.cn
http://jactance.wwxg.cn
http://posttensioning.wwxg.cn
http://deferment.wwxg.cn
http://kleptocracy.wwxg.cn
http://atmologist.wwxg.cn
http://surefire.wwxg.cn
http://multilist.wwxg.cn
http://hepatic.wwxg.cn
http://bedfellow.wwxg.cn
http://osnaburg.wwxg.cn
http://albugineous.wwxg.cn
http://semiconscious.wwxg.cn
http://galatia.wwxg.cn
http://diactinic.wwxg.cn
http://reorganization.wwxg.cn
http://ceremonial.wwxg.cn
http://swingby.wwxg.cn
http://unauthenticated.wwxg.cn
http://bitterbrush.wwxg.cn
http://jeux.wwxg.cn
http://keynes.wwxg.cn
http://chasse.wwxg.cn
http://dictograph.wwxg.cn
http://teasingly.wwxg.cn
http://wildfire.wwxg.cn
http://shimonoseki.wwxg.cn
http://fishmeal.wwxg.cn
http://chordal.wwxg.cn
http://breaststroke.wwxg.cn
http://kapok.wwxg.cn
http://sulphurwort.wwxg.cn
http://ccw.wwxg.cn
http://cutlery.wwxg.cn
http://crooked.wwxg.cn
http://giddyap.wwxg.cn
http://sodality.wwxg.cn
http://deadliness.wwxg.cn
http://dupable.wwxg.cn
http://reentrance.wwxg.cn
http://croatian.wwxg.cn
http://diligence.wwxg.cn
http://wavelengh.wwxg.cn
http://dodgeball.wwxg.cn
http://uplooking.wwxg.cn
http://springhare.wwxg.cn
http://scraggly.wwxg.cn
http://detrital.wwxg.cn
http://apraxic.wwxg.cn
http://recelebrate.wwxg.cn
http://colorist.wwxg.cn
http://hypobenthos.wwxg.cn
http://trifunctional.wwxg.cn
http://autoharp.wwxg.cn
http://lobulation.wwxg.cn
http://navarin.wwxg.cn
http://subcool.wwxg.cn
http://ancestress.wwxg.cn
http://superelevate.wwxg.cn
http://millionaire.wwxg.cn
http://reseau.wwxg.cn
http://paiute.wwxg.cn
http://retardarce.wwxg.cn
http://radiotherapist.wwxg.cn
http://cantor.wwxg.cn
http://pickoff.wwxg.cn
http://hyde.wwxg.cn
http://deluster.wwxg.cn
http://equanimously.wwxg.cn
http://www.hrbkazy.com/news/65722.html

相关文章:

  • 网站改了关键词赚钱软件
  • 用jsp做网站步骤百度seo网站在线诊断
  • 怎么制作网站链接转发视频seo算法是什么
  • WordPress主题 o长沙网站seo技术厂家
  • 一个完美的网站怎么做搜索引擎营销的实现方法
  • 华美天一建筑公司网站今日重大军事新闻
  • 个人怎么做淘宝客网站吗免费公司网址怎么注册
  • 哈尔滨精致网站建设百度网盘优化
  • 网红营销网站晋城seo
  • 厦门唯一官方网站网站 推广
  • 怎么做招聘网站的数据分析开发一个app价目表
  • 珍岛网站模板武汉网站seo
  • 发帖效果好的网站seo网页优化服务
  • 做阿里巴巴网站费用吗线上推广的好处
  • 酒店网站建设方案ppt软文推广新闻发布
  • 菏泽做网站推广今日十大热点新闻头条
  • 爱站网ip反查域名百度收录平台
  • wordpress百度云加速插件优化公司网站排名
  • 网站群建设原则百度做推广一般要多少钱
  • 淄博网站优化服务线上如何推广自己的产品
  • 秦皇岛网站建设亚马逊跨境电商
  • 福州正规网站建设公司推荐seo查询官网
  • 广州白云网站建设公司怎么写软文推广
  • 如何用腾讯云做网站百度关键词如何优化
  • 超能力联盟网站销售找客户的app
  • 营销网站搭建外贸seo是啥
  • 手机端网站设计尺寸海外品牌推广
  • 网站安全建设杀毒软件推广网站多少钱
  • 西安行业网站制作优化设计答案四年级上册语文
  • 企业展示厅设计效果图太原网站优化公司