Palindrome Linked List Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it…
分类:LeetCode题目解答
【leetcode】5. Longest Palindromic Substring 最长回文子串
1. 题目 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of…
10. Regular Expression Matching(hard)
10. Regular Expression Matching 题目 Implement regular expression matching with support for '.' and '*'. '.' Mat…
[LeetCode] Binary Tree Preorder Traversal 二叉树的先序遍历
Given a binary tree, return the preorder traversal of its nodes’ values. For example:Gi…
[LeetCode] Longest Harmonious Subsequence 最长和谐子序列
We define a harmonious array is an array where the difference between its maximum value and its minimum…
[LeetCode] Path Sum IV 二叉树的路径和之四
If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-dig…
[LeetCode] 3Sum Closest 最近三数之和, 3Sum 三数之和
Given an array S of n integers, find three integers in S such that the su…
[LeetCode] Friend Circles 朋友圈
There are N students in a class. Some of them are friends, while some are not. Their friendsh…
[LeetCode] Maximum Depth of Binary Tree 二叉树的最大深度
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest…
[LeetCode] My Calendar II 我的日历之二
Implement a MyCalendarTwo class to store your events. A new event can be added if adding the …
LeetCode之Breadth-first Search题目汇总
Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes…
[Leetcode] Search in Rotated Sorted Array 搜索旋转有序数组
Search in Rotated Sorted Array I Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i…