Leecode 1048. Longest String Chain
1048. Longest String ChainYou are given an array of words where each word consists of lowercase English letters. wordA is a predecessor of wordB if and only if we can insert exactly one letter anywhere in wordA without changing the order of the other characters to make it equal to wordB. For example, "abc" is a predecessor of "abac", while "cba" is not a predecessor of "bcad".A word chain is a sequence of words [word1, word2, ..., wordk] with k...
Leecode 0206. Reverse Linked List
206. Reverse Linked ListGiven the head of a singly linked list, reverse the list, and return the reversed list. Example 1: 12Input: head = [1,2,3,4,5]Output: [5,4,3,2,1] Example 2: 12Input: head = [1,2]Output: [2,1] Example 3: 12Input: head = []Output: [] Constraints: The number of nodes in the list is the range [0, 5000]. -5000 <= Node.val <= 5000 解法 1:迭代解法123456789101112131415161718192021222324252627/** * Definition for singly-linked list. * struct ListNode { * int...


Categories
Archives
- 2025年10月 7
- 2025年09月 19
- 2025年08月 8
- 2025年07月 8
- 2025年06月 8
- 2025年05月 8
- 2025年04月 8
- 2025年03月 8
- 2025年02月 8
- 2025年01月 8
- 2024年12月 9
- 2024年11月 7
- 2024年10月 10
- 2024年09月 10
- 2024年08月 10
- 2024年07月 8
- 2024年06月 8
- 2024年05月 9
- 2024年04月 9
- 2024年03月 9
- 2024年02月 7
- 2024年01月 9
- 2023年12月 8
- 2023年11月 9
- 2023年10月 8
- 2023年09月 6
- 2023年08月 7
- 2023年07月 9
- 2023年06月 8
- 2023年05月 11
- 2023年04月 8
- 2023年03月 8
- 2023年02月 8
- 2023年01月 8
- 2022年12月 9
- 2022年11月 14
- 2022年10月 10
- 2022年09月 7
- 2022年08月 6
- 2022年07月 8
- 2022年06月 10
- 2022年05月 7
- 2022年04月 7
- 2022年03月 4
- 2022年02月 5
- 2022年01月 5
Website Info
Article Count :
385
Runtime :
Total Word Count :
630.2k
Last Update :