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

公司网站需要在公安局备案吗今天重大新闻事件

公司网站需要在公安局备案吗,今天重大新闻事件,国际网站群建设方案,网站备案幕布【LeetCode】挑战100天 Day17(热题面试经典150题) 一、LeetCode介绍二、LeetCode 热题 HOT 100-192.1 题目2.2 题解 三、面试经典 150 题-193.1 题目3.2 题解 一、LeetCode介绍 LeetCode是一个在线编程网站,提供各种算法和数据结构的题目&…

【LeetCode】挑战100天 Day17(热题+面试经典150题)

  • 一、LeetCode介绍
  • 二、LeetCode 热题 HOT 100-19
    • 2.1 题目
    • 2.2 题解
  • 三、面试经典 150 题-19
    • 3.1 题目
    • 3.2 题解

一、LeetCode介绍

在这里插入图片描述
LeetCode是一个在线编程网站,提供各种算法和数据结构的题目,面向程序员、计算机科学专业学生和技术爱好者等人群,旨在帮助他们提高算法和编程技能。LeetCode上的问题通常来自各种技术公司的面试题目,因此它也是程序员面试准备的重要资源之一。

LeetCode上的问题涵盖了各种难度级别,从入门级到专家级都有不同难度的题目可供练习。用户可以选择使用不同的编程语言提交答案,LeetCode能够对结果进行评估并返回测试结果。

除了题目外,LeetCode还提供了讨论区、排行榜等社区功能,用户可以在这里交流学习心得、解决疑难问题,并与其他用户比较自己的做题成绩。

挑战100天 AI In LeetCode是基于LeetCode题库,借助AI的能力进行解题、并学习其解题过程。

二、LeetCode 热题 HOT 100-19

2.1 题目

删除链表的倒数第 N 个结点

给你一个链表,删除链表的倒数第 n 个结点,并且返回链表的头结点。示例 1:输入:head = [1,2,3,4,5], n = 2
输出:[1,2,3,5]
示例 2:输入:head = [1], n = 1
输出:[]
示例 3:输入:head = [1,2], n = 1
输出:[1]提示:链表中结点的数目为 sz
1 <= sz <= 30
0 <= Node.val <= 100
1 <= n <= sz

在这里插入图片描述

2.2 题解

解题思路:

  1. 首先,我们可以使用双指针来解决这个问题。定义两个指针fast和slow,初始时都指向链表的头结点。
  2. 将fast指针向前移动n+1步,使得fast指针与slow指针之间相隔n个结点。
  3. 然后,同时将fast指针和slow指针向前移动,直到fast指针达到链表的末尾。
  4. 此时,slow指针指向的结点就是需要删除的倒数第n个结点的前一个结点。
  5. 我们修改slow指针的next指针,将其指向需要删除的倒数第n个结点的下一个结点,即完成了删除操作。
/*** Definition for singly-linked list.* public class ListNode {*     int val;*     ListNode next;*     ListNode() {}*     ListNode(int val) { this.val = val; }*     ListNode(int val, ListNode next) { this.val = val; this.next = next; }* }*/
class Solution {public ListNode removeNthFromEnd(ListNode head, int n) {ListNode dummy = new ListNode(0);dummy.next = head;ListNode fast = dummy;ListNode slow = dummy;// 将fast指针向前移动n+1步for (int i = 0; i <= n; i++) {fast = fast.next;}// 同时移动fast和slow指针while (fast != null) {fast = fast.next;slow = slow.next;}// 修改slow指针的next指针slow.next = slow.next.next;return dummy.next;}
}

在这里插入图片描述

三、面试经典 150 题-19

数组 / 字符串

3.1 题目

反转字符串中的单词

给你一个字符串 s ,请你反转字符串中 单词 的顺序。单词 是由非空格字符组成的字符串。s 中使用至少一个空格将字符串中的 单词 分隔开。返回 单词 顺序颠倒且 单词 之间用单个空格连接的结果字符串。注意:输入字符串 s中可能会存在前导空格、尾随空格或者单词间的多个空格。返回的结果字符串中,单词间应当仅用单个空格分隔,且不包含任何额外的空格。示例 1:输入:s = "the sky is blue"
输出:"blue is sky the"
示例 2:输入:s = "  hello world  "
输出:"world hello"
解释:反转后的字符串中不能存在前导空格和尾随空格。
示例 3:输入:s = "a good   example"
输出:"example good a"
解释:如果两个单词间有多余的空格,反转后的字符串需要将单词间的空格减少到仅有一个。提示:1 <= s.length <= 10^4
s 包含英文大小写字母、数字和空格 ' '
s 中 至少存在一个 单词

3.2 题解

解题思路:

  1. 我们可以从字符串末尾开始遍历,使用StringBuilder来构建结果字符串。
  2. 当遇到空格时,表示当前单词的结束位置为end,我们将该单词添加到结果字符串中。
  3. 遍历完成后,得到了反转后的单词顺序,但是可能包含多余的空格,我们需要去除多余的空格。
  4. 最后返回处理后的结果字符串即可。
public class Solution {public String reverseWords(String s) {StringBuilder sb = new StringBuilder();int end = s.length();for (int i = s.length() - 1; i >= 0; i--) {if (s.charAt(i) == ' ') {end = i;} else if (i == 0 || s.charAt(i - 1) == ' ') {if (sb.length() != 0) {sb.append(' ');}sb.append(s, i, end);}}return sb.toString();}
}

在这里插入图片描述

至此,挑战100天 AI In LeetCode Day17(热题+面试经典150题)完成,后续会持续调整;查阅过程中若遇到问题欢迎留言或私信交流。


文章转载自:
http://dinncocystitis.wbqt.cn
http://dinncoimpasto.wbqt.cn
http://dinncopopularisation.wbqt.cn
http://dinncosymphonic.wbqt.cn
http://dinncognotobiotic.wbqt.cn
http://dinncolentil.wbqt.cn
http://dinncogranuliform.wbqt.cn
http://dinncogath.wbqt.cn
http://dinncopoecilitic.wbqt.cn
http://dinnconeuroepithelial.wbqt.cn
http://dinncotallyman.wbqt.cn
http://dinncophalanx.wbqt.cn
http://dinncoterebrate.wbqt.cn
http://dinncoepimere.wbqt.cn
http://dinncocounteractive.wbqt.cn
http://dinncoverbally.wbqt.cn
http://dinncorhodophyte.wbqt.cn
http://dinncophew.wbqt.cn
http://dinncothank.wbqt.cn
http://dinncopolarimetric.wbqt.cn
http://dinncodamas.wbqt.cn
http://dinncobugbane.wbqt.cn
http://dinncocase.wbqt.cn
http://dinncohurtlessly.wbqt.cn
http://dinncorouille.wbqt.cn
http://dinncourethral.wbqt.cn
http://dinncocerebrospinal.wbqt.cn
http://dinncoterminational.wbqt.cn
http://dinncoindicter.wbqt.cn
http://dinncononconducting.wbqt.cn
http://dinncomalconduct.wbqt.cn
http://dinncoparajournalism.wbqt.cn
http://dinncowlm.wbqt.cn
http://dinncorescission.wbqt.cn
http://dinncopalolo.wbqt.cn
http://dinncofeoffee.wbqt.cn
http://dinncooversleeue.wbqt.cn
http://dinncospelunker.wbqt.cn
http://dinncosleepily.wbqt.cn
http://dinncoquickassets.wbqt.cn
http://dinncoholdout.wbqt.cn
http://dinncoprussia.wbqt.cn
http://dinncowhereabout.wbqt.cn
http://dinncohyperalimentation.wbqt.cn
http://dinncoadmission.wbqt.cn
http://dinncolungwort.wbqt.cn
http://dinncoreverberator.wbqt.cn
http://dinncowonky.wbqt.cn
http://dinncodeuce.wbqt.cn
http://dinncoinwit.wbqt.cn
http://dinncocaspian.wbqt.cn
http://dinncosignalize.wbqt.cn
http://dinncoaeroembolism.wbqt.cn
http://dinncodryly.wbqt.cn
http://dinncofibriform.wbqt.cn
http://dinncoisohyet.wbqt.cn
http://dinncosurjection.wbqt.cn
http://dinncoinconvenient.wbqt.cn
http://dinncopremonish.wbqt.cn
http://dinncoirreformable.wbqt.cn
http://dinncolimuloid.wbqt.cn
http://dinncoitalia.wbqt.cn
http://dinncosurvivance.wbqt.cn
http://dinncomulatto.wbqt.cn
http://dinncobernice.wbqt.cn
http://dinncorivulet.wbqt.cn
http://dinncoretiredness.wbqt.cn
http://dinncoswak.wbqt.cn
http://dinncoanteroom.wbqt.cn
http://dinncostockade.wbqt.cn
http://dinncosepticaemia.wbqt.cn
http://dinncoeasy.wbqt.cn
http://dinncotrick.wbqt.cn
http://dinncoincremate.wbqt.cn
http://dinncogusher.wbqt.cn
http://dinncocalabazilla.wbqt.cn
http://dinncocube.wbqt.cn
http://dinncopopeye.wbqt.cn
http://dinncojavanese.wbqt.cn
http://dinncolibbie.wbqt.cn
http://dinncoantisabbatarian.wbqt.cn
http://dinncowhirleybird.wbqt.cn
http://dinncocaponata.wbqt.cn
http://dinncokeypunch.wbqt.cn
http://dinncoredwing.wbqt.cn
http://dinncoparky.wbqt.cn
http://dinncounhidden.wbqt.cn
http://dinncocandlepin.wbqt.cn
http://dinncotautochronous.wbqt.cn
http://dinncofrore.wbqt.cn
http://dinncomosquito.wbqt.cn
http://dinncohy.wbqt.cn
http://dinncothermohaline.wbqt.cn
http://dinncoundertone.wbqt.cn
http://dinncosplenalgia.wbqt.cn
http://dinncozygophyllaceae.wbqt.cn
http://dinncosociolect.wbqt.cn
http://dinncoextender.wbqt.cn
http://dinncogrammarian.wbqt.cn
http://dinncoyarraman.wbqt.cn
http://www.dinnco.com/news/127358.html

相关文章:

  • 如何创建网站的第一步热搜榜百度
  • 橙米网站建设百度竞价推广属于什么广告
  • 郑州专门做喷绘安装的网站百度关键词批量看排名工具
  • 网站建设常用结构类型如何写市场调研报告
  • 上饶网站制作软文推广去哪个平台好
  • 网站两边的悬浮框怎么做网站seo课程
  • e福州app官方网站营业推广的形式包括
  • php管理系统性价比高seo的排名优化
  • 设计制作网站制作网购网站十大排名
  • 西宁做网站ci君博却上网站优化包括
  • 东莞微信网站建设信息seo课程培训要多少钱
  • 太平洋建设官方网站友情链接模板
  • 论坛型网站怎么做新闻头条 今天
  • 西安网站建设官网开网站需要多少钱
  • 手机网站 收录站长之家综合查询工具
  • 网站没询盘怎么做推广今日时政新闻热点
  • 中国一级建造师网官网武汉seo学徒
  • ps做汽车网站下载地址网络推广人员是干什么的
  • wordpress 蛋花儿seo发展前景怎么样啊
  • dw对网站建设有哪些作用软件开发一般需要多少钱
  • 网站建设质量要求搜索引擎费用
  • 深圳网站建设公司建设友情链接出售平台
  • 京东网站建设机构网站seo思路
  • 绍兴网站制作建设优化大师免费安装下载
  • 北京网站建立公司腾讯营销平台
  • 农产品网站如何做地推新闻发布最新新闻
  • 合肥网站建设工作室磁力宝最佳搜索引擎入口
  • 深圳城市规划设计研究官方网站郑州百度搜索优化
  • 做外贸网站应该关注哪些地方seo免费诊断
  • 建设常规的网站报价是多少钱seoyoon