Given a string s and a list of strings dict, you need to add a closed pair of bold tag&n…
分类:LeetCode
LeetCode | Binary Tree Postorder Traversal
题目: Given a binary tree, return the postorder traversal of its nodes’ values. For example: Giv…
[Leetcode] Summary Ranges 统计区间
Summary Ranges Given a sorted integer array without duplicates, return the summary of its ranges. For example,…
[Leetcode] Construct Binary Tree from Traversal 根据遍历序列建树
Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, cons…
LeetCode算法题-Design LinkedList(Java实现)
这是悦乐书的第300次更新,第319篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第168题(顺位题号是707)。设计链表的实现。您可以选择使用单链表或双链表。单链表中的节点应该具有两个属性…
LeetCode算法题-Number of Segments in a String(Java实现)
这是悦乐书的第226次更新,第239篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第93题(顺位题号是434)。计算字符串中的段数,其中段定义为非空格字符的连续序列。请注意,该字符串不包含任…
二刷10. Regular Expression Matching
这道题这次算是刷透了,算是比较稳妥的解法,现场能解释清楚。 class Solution { /* s:"" a b c c e f p: "" T F F a F T | b F T | c | * ---------…
572. Subtree of Another Tree
我也不知道为什么一开始把isSame无脑简化为s == t这样了?判断两颗树是否相等其实是另外一道题100. Same Tree s == t 意思是说s和t是同一棵树的reference, 但是我们这里的same tr…
[LeetCode] Concatenated Words 连接的单词
Given a list of words (without duplicates), please write a program that returns all concatenated words …
[LeetCode] Design Circular Deque 设计环形双向队列
Design your implementation of the circular double-ended queue (deque). Your implementation should suppo…
[LeetCode] Maximum Binary Tree 最大二叉树
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: …
LeetCode | Same Tree
题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considere…