![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 74
m0_62024778
这个作者很懒,什么都没留下…
展开
-
5. 最长回文子串 Longest Palindromic Substring - 中等
最长回文子串 Longest Palindromic Substring题目描述解题方法方法一:中心扩展法方法二:动态规划法题目描述Given a string s, return the longest palindromic substring in s.Example 1:Input: s = “babad”Output: “bab”Note: “aba” is also a valid answer.Example 2:Input: s = “cbbd”Output: “bb原创 2021-11-16 22:29:32 · 75 阅读 · 0 评论 -
409. 最长回文串(Longest Palindrome)- 简单
最长回文串 Longest Palindrome题目描述解题方法题目描述Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.Letters are case sensitive, for example, "Aa" is not considered a pal原创 2021-11-13 01:24:32 · 372 阅读 · 0 评论 -
234. 回文链表 Palindrome Linked List - 简单
回文链表(Palindrome Linked List) 题目描述解题方法递归法快慢指针法题目描述Given the head of a singly linked list, return true if it is a palindrome.Example 1:Input: head = [1,2,2,1]Output: trueExample 2:Input: head = [1,2]Output: falseConstraints:The number of nodes原创 2021-11-11 09:36:23 · 58 阅读 · 0 评论 -
25. k个一组翻转链表 (Reverse Nodes in k-Group)
k个一组翻转链表 Reverse Nodes in k-Group题目描述解题方法方法一:迭代+递归方法二:迭代法题目描述Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the numb原创 2021-10-18 12:04:44 · 105 阅读 · 0 评论 -
92.反转链表 II (Reverse Linked List II)- 中等
反转链表 II (Reverse Linked List II)题目描述解题方法递归法迭代法方法一:穿针引线方法二:一次遍历「穿针引线」(头插法)题目描述Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the原创 2021-10-16 22:53:42 · 69 阅读 · 0 评论 -
206. 反转链表 (Reverse Linked List) - 简单
反转链表题目描述解题方法迭代法递归法可能出现的问题题目描述Given the head of a singly linked list, reverse the list, and return the reversed list.Example 1:Input: head = [1,2,3,4,5]Output: [5,4,3,2,1]Example 2:Input: head = [1,2]Output: [2,1]Example 3:Input: head = []Outp原创 2021-10-12 17:04:04 · 64 阅读 · 0 评论 -
322. 零钱兑换(Coin Change)- 中等
零钱兑换(Coin Change)题目描述解题方法题目描述You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.Return the fewest number of coins that you need to make up that amount. If that am原创 2021-10-11 19:43:24 · 124 阅读 · 0 评论 -
509. 斐波那契数列( Fibonacci Number)- 简单
斐波那契数列 Fibonacci Number题目描述题解解法一:动态规划解法二:动态规划(优化空间复杂度)解法三: 递归(暴力解法)题目描述题解解法一:动态规划解法二:动态规划(优化空间复杂度)解法三: 递归(暴力解法)...原创 2021-10-09 06:01:03 · 168 阅读 · 0 评论