Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in …
分类:LeetCode题目解答
[LeetCode] Sentence Similarity II 句子相似度之二
Given two sentences words1, words2 (each represented as an array of strings), and a list of s…
[LeetCode] Validate Binary Search Tree 验证二叉搜索树
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as fo…
[LeetCode] Reverse Words in a String 翻转字符串中的单词
Given an input string, reverse the string word by word. For example, Given s = “the sky is blue…
[Leetcode] Flatten Binary Tree to Linked List 整平二叉树
Flatten Binary Tree to Linked List Given a binary tree, flatten it to a linked list in-place. For example, Giv…
[LeetCode] Top K Frequent Words 前K个高频词
Given a non-empty list of words, return the k most frequent elements. Your answer should be s…
[LeetCode] Unique Morse Code Words 独特的摩斯码单词
International Morse Code defines a standard encoding where each letter is mapped to a series of dots an…
力扣(LeetCode)543
题目地址:https://leetcode-cn.com/probl…题目描述:给定一棵二叉树,你需要计算它的直径长度。一棵二叉树的直径长度是任意两个结点路径长度中的最大值。这条路径可能穿过根结点。 示例 :…
[LeetCode] Top K Frequent Elements 前K个高频元素
Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: n…
[LeetCode] Cut Off Trees for Golf Event 为高尔夫赛事砍树
You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negativ…
[Lintcode] Longest Increasing Subsequence 最长上升序列
Longest Increasing Subsequence 本文最新版本位于 https://yanjia.me/zh/2018/11/… 给定一个整数序列,找到最长上升子序列(LIS),返回LIS的长度。…
[LeetCode] Valid Parentheses 验证括号
Given a string containing just the characters '(', ')', '{', '}', '[' and…