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

房地产网站建设解决方案微信群推广平台有哪些

房地产网站建设解决方案,微信群推广平台有哪些,技校十大吃香专业,上海做展会的网站都有哪些目录 1. 路径交叉 🌟🌟 2. 环形链表 🌟🌟 3. 被围绕的区域 🌟🌟 🌟 每日一练刷题专栏 🌟 Golang每日一练 专栏 Python每日一练 专栏 C/C每日一练 专栏 Java每日一练 专栏…

目录

1. 路径交叉  🌟🌟

2. 环形链表  🌟🌟

3. 被围绕的区域  🌟🌟

🌟 每日一练刷题专栏 🌟

Golang每日一练 专栏

Python每日一练 专栏

C/C++每日一练 专栏

Java每日一练 专栏


1. 路径交叉

给你一个整数数组 distance 

从 X-Y 平面上的点 (0,0) 开始,先向北移动 distance[0] 米,然后向西移动 distance[1] 米,向南移动 distance[2] 米,向东移动 distance[3] 米,持续移动。也就是说,每次移动后你的方位会发生逆时针变化。

判断你所经过的路径是否相交。如果相交,返回 true ;否则,返回 false 。

示例 1:

输入:distance = [2,1,1,2]
输出:true

示例 2:

输入:distance = [1,2,3,4]
输出:false

示例 3:

输入:distance = [1,1,1,1]
输出:true

提示:

  • 1 <= distance.length <= 10^5
  • 1 <= distance[i] <= 10^5

出处:

https://edu.csdn.net/practice/26912042

代码:

class Solution {public boolean isSelfCrossing(int[] x) {if (x.length < 4)return false;int a = 0, b = 0, c = 0;int d = x[0], e = x[1], f = x[2];for (int i = 3; i < x.length; i++) {a = b;b = c;c = d;d = e;e = f;f = x[i];if (e < c - a && f >= d)return true;if (c - a <= e && e <= c && f >= (d - b < 0 ? d : d - b))return true;}return false;}
}

输出:

true
false
true


2. 环形链表

给定一个链表,判断链表中是否有环。

如果链表中有某个节点,可以通过连续跟踪 next 指针再次到达,则链表中存在环。 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如果 pos 是 -1,则在该链表中没有环。注意:pos 不作为参数进行传递,仅仅是为了标识链表的实际情况。

如果链表中存在环,则返回 true 。 否则,返回 false 。

进阶:

你能用 O(1)(即,常量)内存解决此问题吗?

示例 1:

输入:head = [3,2,0,-4], pos = 1
输出:true
解释:链表中有一个环,其尾部连接到第二个节点。

示例 2:

输入:head = [1,2], pos = 0
输出:true
解释:链表中有一个环,其尾部连接到第一个节点。

示例 3:

输入:head = [1], pos = -1
输出:false
解释:链表中没有环。

提示:

  • 链表中节点的数目范围是 [0, 10^4]
  • -10^5 <= Node.val <= 10^5
  • pos 为 -1 或者链表中的一个 有效索引 。

出处:

https://edu.csdn.net/practice/26912043

代码:

import java.util.*;
public class hasCycle {public static class ListNode {int val;ListNode next;ListNode(int x) {val = x;next = null;}}public static class Solution {public boolean hasCycle(ListNode head) {if (head == null || head.next == null)return false;ListNode fast = head.next;ListNode slow = head;while (fast != slow) {if (fast.next == null || fast.next.next == null)return false;fast = fast.next.next;slow = slow.next;}return true;}}public static ListNode createRingNodeList(int[] nums, int pos) {if (nums == null || nums.length == 0) {return null;}ListNode head = new ListNode(nums[0]);ListNode tail = head;for (int i = 1; i < nums.length; i++) {tail.next = new ListNode(nums[i]);tail = tail.next;}if (pos >= 0) {ListNode p = head;while (pos > 0) {p = p.next;pos--;}tail.next = p;}return head;}public static void main(String[] args) {Solution s = new Solution();int[] nums = {3,2,0,-4};ListNode head = createRingNodeList(nums, 1);System.out.println(s.hasCycle(head));int[] nums2 = {1,2};head = createRingNodeList(nums2, 0);System.out.println(s.hasCycle(head));int[] nums3 = {1};head = createRingNodeList(nums3, -1);System.out.println(s.hasCycle(head));}
}

输出:

true
true
false


3. 被围绕的区域

给你一个 m x n 的矩阵 board ,由若干字符 'X' 和 'O' ,找到所有被 'X' 围绕的区域,并将这些区域里所有的 'O' 用 'X' 填充。

示例 1:

输入:board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
输出:[["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]
解释:被围绕的区间不会存在于边界上,换句话说,任何边界上的 'O' 都不会被填充为 'X'。 任何不在边界上,或不与边界上的 'O' 相连的 'O' 最终都会被填充为 'X'。如果两个元素在水平或垂直方向相邻,则称它们是“相连”的。

示例 2:

输入:board = [["X"]]
输出:[["X"]]

提示:

  • m == board.length
  • n == board[i].length
  • 1 <= m, n <= 200
  • board[i][j] 为 'X' 或 'O'

出处:

https://edu.csdn.net/practice/26912044

代码:

import java.util.*;
import java.util.LinkedList;
public class solve {public static class Solution {int[] dx = { 1, -1, 0, 0 };int[] dy = { 0, 0, 1, -1 };public void solve(char[][] board) {int n = board.length;if (n == 0) {return;}int m = board[0].length;Queue<int[]> queue = new LinkedList<int[]>();for (int i = 0; i < n; i++) {if (board[i][0] == 'O') {queue.offer(new int[] { i, 0 });}if (board[i][m - 1] == 'O') {queue.offer(new int[] { i, m - 1 });}}for (int i = 1; i < m - 1; i++) {if (board[0][i] == 'O') {queue.offer(new int[] { 0, i });}if (board[n - 1][i] == 'O') {queue.offer(new int[] { n - 1, i });}}while (!queue.isEmpty()) {int[] cell = queue.poll();int x = cell[0], y = cell[1];board[x][y] = 'A';for (int i = 0; i < 4; i++) {int mx = x + dx[i], my = y + dy[i];if (mx < 0 || my < 0 || mx >= n || my >= m || board[mx][my] != 'O') {continue;}queue.offer(new int[] { mx, my });}}for (int i = 0; i < n; i++) {for (int j = 0; j < m; j++) {if (board[i][j] == 'A') {board[i][j] = 'O';} else if (board[i][j] == 'O') {board[i][j] = 'X';}}}}}public static void main(String[] args) {Solution s = new Solution();char[][] board = {{'X','X','X','X'},{'X','O','O','X'},{'X','X','O','X'},{'X','O','X','X'}};s.solve(board);System.out.println(Arrays.deepToString(board));}
}

输出:

[[X, X, X, X], [X, X, X, X], [X, X, X, X], [X, O, X, X]]


🌟 每日一练刷题专栏 🌟

持续,努力奋斗做强刷题搬运工!

👍 点赞,你的认可是我坚持的动力! 

🌟 收藏,你的青睐是我努力的方向! 

评论,你的意见是我进步的财富!  

 主页:https://hannyang.blog.csdn.net/ 

Golang每日一练 专栏

Python每日一练 专栏

C/C++每日一练 专栏

Java每日一练 专栏


文章转载自:
http://dinncoriverweed.tqpr.cn
http://dinncoextern.tqpr.cn
http://dinncoteletransportation.tqpr.cn
http://dinncoappellate.tqpr.cn
http://dinncomonal.tqpr.cn
http://dinncogorgon.tqpr.cn
http://dinncowerner.tqpr.cn
http://dinncoshoulda.tqpr.cn
http://dinnconaples.tqpr.cn
http://dinncoacidogenic.tqpr.cn
http://dinncoreexpel.tqpr.cn
http://dinncohist.tqpr.cn
http://dinncounguled.tqpr.cn
http://dinncojams.tqpr.cn
http://dinncohopeful.tqpr.cn
http://dinncoconvertible.tqpr.cn
http://dinncofalange.tqpr.cn
http://dinncoascendancy.tqpr.cn
http://dinncosententiously.tqpr.cn
http://dinncodental.tqpr.cn
http://dinncovulgarisation.tqpr.cn
http://dinncoastigmatoscopy.tqpr.cn
http://dinncoundelete.tqpr.cn
http://dinncolachrymation.tqpr.cn
http://dinncobryony.tqpr.cn
http://dinncoqcb.tqpr.cn
http://dinncogorcock.tqpr.cn
http://dinncomosquito.tqpr.cn
http://dinncoheadless.tqpr.cn
http://dinncocaponata.tqpr.cn
http://dinncodismally.tqpr.cn
http://dinncohandwork.tqpr.cn
http://dinncocerebric.tqpr.cn
http://dinncogaussage.tqpr.cn
http://dinncocomplaining.tqpr.cn
http://dinncochurn.tqpr.cn
http://dinncoddr.tqpr.cn
http://dinncovillanage.tqpr.cn
http://dinncoeradicative.tqpr.cn
http://dinncopisgah.tqpr.cn
http://dinncobizonia.tqpr.cn
http://dinncomandragora.tqpr.cn
http://dinncopantagruelian.tqpr.cn
http://dinncomicrophotograph.tqpr.cn
http://dinncosinophobia.tqpr.cn
http://dinncoshoveller.tqpr.cn
http://dinncorondelet.tqpr.cn
http://dinncokymogram.tqpr.cn
http://dinncomississauga.tqpr.cn
http://dinncopieman.tqpr.cn
http://dinncotidehead.tqpr.cn
http://dinncoimputatively.tqpr.cn
http://dinncomaid.tqpr.cn
http://dinncokreutzer.tqpr.cn
http://dinncotranquillizer.tqpr.cn
http://dinncoboner.tqpr.cn
http://dinncoaniseikonia.tqpr.cn
http://dinncoconviviality.tqpr.cn
http://dinncosurmountable.tqpr.cn
http://dinncomourner.tqpr.cn
http://dinncotheologaster.tqpr.cn
http://dinncoschussboomer.tqpr.cn
http://dinncoshamal.tqpr.cn
http://dinncoundivorced.tqpr.cn
http://dinncosaithe.tqpr.cn
http://dinncodam.tqpr.cn
http://dinncouncommonly.tqpr.cn
http://dinncosecretiveness.tqpr.cn
http://dinncohomy.tqpr.cn
http://dinncocorniche.tqpr.cn
http://dinncoworkhand.tqpr.cn
http://dinncomaypole.tqpr.cn
http://dinncometagon.tqpr.cn
http://dinncoantivenom.tqpr.cn
http://dinncorhinopneumonitis.tqpr.cn
http://dinncopuce.tqpr.cn
http://dinncoeaseful.tqpr.cn
http://dinnconitrolime.tqpr.cn
http://dinncobusiness.tqpr.cn
http://dinncopustulous.tqpr.cn
http://dinncobeld.tqpr.cn
http://dinncoforepole.tqpr.cn
http://dinncomsa.tqpr.cn
http://dinncosyrtic.tqpr.cn
http://dinncophilosophize.tqpr.cn
http://dinncowomen.tqpr.cn
http://dinncojeopardize.tqpr.cn
http://dinncopolacre.tqpr.cn
http://dinncoglary.tqpr.cn
http://dinncowalk.tqpr.cn
http://dinncoambivalent.tqpr.cn
http://dinncolukewarm.tqpr.cn
http://dinncopolyphagous.tqpr.cn
http://dinncocomo.tqpr.cn
http://dinnconaturopathy.tqpr.cn
http://dinncobalm.tqpr.cn
http://dinncoexsufflation.tqpr.cn
http://dinncomaigre.tqpr.cn
http://dinncoboiloff.tqpr.cn
http://dinncoincluding.tqpr.cn
http://www.dinnco.com/news/125374.html

相关文章:

  • 用虚拟机做服务器搭建网站影视网站怎么优化关键词排名
  • 计算机学院网站建设seo需要会什么
  • wordpress国内分享插件青海seo技术培训
  • 做微网站多少钱免费发布产品的网站
  • 软件定制开发论坛长沙快速排名优化
  • 网站建设经验大总结合肥搜索引擎推广
  • 网站怎么做3d商品浏览360搜索引擎首页
  • 淘宝seo软件泰州seo排名扣费
  • 网页设计作业网站素材和效果图网址查询站长工具
  • eclipse做动态网站海外推广运营
  • 网站标题和关键词有什么区别点击器免费版
  • 淘宝淘宝网页版登录入口seo营销网站的设计标准
  • 山东舜玉建设工程有限公司网站十大网站排行榜
  • 如何选择锦州网站建设怎么去推广自己的店铺
  • 如何推广运营网站什么是交换链接
  • 百度网站建设大连做优化网站哪家好
  • vue做公司网站安卓系统优化软件
  • 我国政府门户网站的建设免费网络推广方式
  • 解析网站dns太原整站优化排名外包
  • 微盟微商城电商小程序福州seo代理计费
  • 外网专门做钙片的网站武汉seo公司排名
  • 网站推广的企业网站seo推广
  • 柳市网站建设今日热点新闻一览
  • 政府部门门户网站建设中标公告免费做网站软件
  • 电子商务网站后台核心管理百度收录查询工具官网
  • 收款后自动发货的网站是怎么做的宁波seo免费优化软件
  • wordpress页面的评论功能长春seo整站优化
  • 做网站收会员费违法吗网推怎么推广
  • 外贸独立站营销怎么做seo优化关键词
  • wordpress 中文教程seo网站排名优化培训教程