Djt's Blog

  • Home

  • Tags

  • Categories

  • Archives

  • Search

LeetCode-019-删除链表的倒数第N个节点

Posted on 2019-04-25 | In LeetCode | Views:

1. 题目:删除链表的倒数第N个节点 给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点。 示例: 给定一个链表: 1->2->3->4->5, 和 n = 2.当删除了倒数第二个节点后,链表变为 1->2->3->5. 说明: 给定的 n 保 ...

Read more »

LeetCode-237-删除链表中的节点

Posted on 2019-04-25 | Edited on 2019-04-26 | In LeetCode | Views:

1. 题目:请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点,你将只被给定要求被删除的节点。 现有一个链表 – head = [4,5,1,9],它可以表示为: 示例 1: 输入: head = [4,5,1,9], node = 5输出: [4,1,9]解释: 给定你链表中值为 5 的 ...

Read more »

LeetCode-014-最长公共前缀

Posted on 2019-04-25 | In LeetCode | Views:

1. 题目:最长公共前缀 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串 ""。 示例 1: 输入: ["flower","flow","flight"]输出: "fl&quo ...

Read more »

LeetCode-038-报数

Posted on 2019-04-24 | In LeetCode | Views:

1. 题目:报数 报数序列是一个整数序列,按照其中的整数的顺序进行报数,得到下一个数。其前五项如下: 1. 12. 113. 214. 12115. 111221 1 被读作 "one 1" ("一个一") , 即 ...

Read more »

LeetCode-028-实现strStr()

Posted on 2019-04-24 | In LeetCode | Views:

1. 题目:实现strStr() 实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = " ...

Read more »

LeetCode-008-字符串转换整数 (atoi)

Posted on 2019-04-23 | In LeetCode | Views:

1. 题目:字符串转换整数 (atoi) 请你来实现一个 atoi 函数,使其能将字符串转换成整数。 首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止。 当我们寻找到的第一个非空字符为正或者负号时,则将该符号与之后面尽可能多的连续数字组合起来,作为该整数的正负号;假如第 ...

Read more »

LeetCode-125-验证回文串

Posted on 2019-04-22 | In LeetCode | Views:

1. 题目:验证回文字符串 给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。 说明:本题中,我们将空字符串定义为有效的回文串。 示例 1: 输入: "A man, a plan, a canal: Panama"输出: true 示例 2: 输入: ...

Read more »

LeetCode-242-有效的字母异位词

Posted on 2019-04-22 | In LeetCode | Views:

1. 题目:有效的字母异位词 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的一个字母异位词。 示例 1: 输入: s = "anagram", t = "nagaram"输出: true 示例 2: 输入: s = "rat&q ...

Read more »

LeetCode-387-字符串中的第一个唯一字符

Posted on 2019-04-21 | In LeetCode | Views:

1. 题目:字符串中的第一个唯一字符 给定一个字符串,找到它的第一个不重复的字符,并返回它的索引。如果不存在,则返回 -1。 案例: s = "leetcode"返回 0.s = "loveleetcode",返回 2. 注意事项:您可以假定该字符串只包含小写 ...

Read more »

LeetCode-007-整数反转

Posted on 2019-04-21 | In LeetCode | Views:

1. 题目:整数反转 给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 示例 1: 输入: 123输出: 321 示例 2: 输入: -123输出: -321 示例 3: 输入: 120输出: 21 注意: 假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 ...

Read more »
123…8
Djt

Djt

Hello World!
80 posts
5 categories
62 tags
GitHub E-Mail
© 2019 Djt
Powered by Hexo v3.8.0
|
Theme – NexT.Pisces v7.0.1