题目地址:https://leetcode-cn.com/probl…题目描述:对于一个具有树特征的无向图,我们可选择任何一个节点作为根。图因此可以成为树,在所有可能的树中,具有最小高度的树被称为最小高度树。…
分类:LeetCode
[LeetCode] Pow(x, n) 求x的n次方
Implement pow(x, n), which calculates x raised to the power n(xn). Example 1: …
[LeetCode] Increasing Triplet Subsequence 递增的三元子序列
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array…
[LeetCode] Reconstruct Original Digits from English 从英文中重建数字
Given a non-empty string containing an out-of-order English representation of digits 0-9…
21. Merge Two Sorted Lists
21. Merge Two Sorted Lists 题目 Merge two sorted linked lists and return it as a new list. The new list should b…
125. Valid Palindrome
欢迎fork and star:Nowcoder-Repository-github 125. Valid Palindrome 题目 注意c/c++大小写的转换方法 c基本库函数isalnum(),tolower(),…
Leetcode. 子矩阵的最大累加和问题
问题描述 给定一个矩阵Matrix, 其中的值由正, 有负, 有0, 返回子矩阵的最大累加和. 例如: 给定矩阵 | -90 | 48 |78 | | 64 | -40 | 64 | | -81 | -7 | 66 | …
792. Number of Matching Subsequences &524. Longest Word in Dictionary through Deleting
Number of Matching Subsequences Longest Word in Dictionary through Deleting 这两道题一起来总结一下。 把它们放在一起,是因为他俩几乎是同一道题。…
LeetCode算法题-Ugly Number(Java实现-四种解法)
这是悦乐书的第199次更新,第208篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第64题(顺位题号是263)。编写一个程序来检查给定的数字是否是一个丑陋的数字。丑陋的数字是正数,其主要因子…
527. Word Abbreviation
Hard Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for e…
Day9. Move Zeroes(283)
问题描述 Given an array nums, write a function to move all 0’s to the end of it while maintaining the relati…
[LeetCode] Flatten 2D Vector 压平二维向量
Implement an iterator to flatten a 2d vector. For example,Given 2d vector = [ [1,2], [3], [4,5,6] ] &nb…