Given a binary tree, find the length of the longest path where each node in the path has the same value…
分类:LeetCode
LeetCode | Regular Expression Matching
题目: Implement regular expression matching with support for '.' and '*'. '.' Matches any single …
LeetCode算法题-Maximum Average Subarray I(Java实现)
这是悦乐书的第278次更新,第294篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第146题(顺位题号是643)。给定由n个整数组成的数组,找到具有最大平均值的长度为k的连续子数组,并输出最…
287. 寻找重复数
287. 寻找重复数 问题 给定一个包含 个整数的数组 ,其数字都在 到 之间(包括 和 ),可知至少存在一个重复的整数。假设只有一个重复的整数,找出这个重复的数。 示例 1: 输入: 输出: 示例 2: 输入: 输出:…
[Leetcode] 003 Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. Examples: Given “…
LeetCode | Minimum Window Substring
题目: Given a string S and a string T, find the minimum window in S which will contain all the characters in T i…
LeetCode | Search Insert Position(查找插入位置)
Given a sorted array and a target value, return the index if the target is found. If not, return the index whe…
[LeetCode][Two Pointers] 159. Longest Substring with At Most Two Distinct Characters
Problem More LeetCode Discussions Given a string, find the length of the longest substring T that contains at …
Leetcode之724-寻找数组的中心索引(Find Pivot Index)
前言 个人网站 公众号: 北京程序猿, 网站 : https://yaml.vip 算法题 题干 给定一个整数类型的数组 nums,请编写一个能够返回数组“中心索引”的方法。 我们是这样定义数组中心索引的:数组中心索引的…
41. First Missing Positive
41. First Missing Positive 题目 Given an unsorted integer array, find the first missing positive integer. For ex…
[LeetCode] Subsets 子集合,Subsets II 子集合之二
Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must …
【leetcode】100. Same Tree
1. 题目 Given two binary trees, write a function to check if they are equal or not. Two binary trees are conside…