摘要:
/** * 687. Longest Univalue Path(最长的相同值路经) * https://leetcode.com/problems/longest-univalue-path/description/ * https://www.youtube.com/watch?v=yX1hVh 阅读全文
摘要:
/** *543. Diameter of Binary Tree * https://leetcode.com/problems/diameter-of-binary-tree/description/ * */class TreeNode(var `val`: Int) { var left: 阅读全文
摘要:
class LargestRangeOfArray { /* * Given an array of integers, return the largest range, inclusive, of integers that are all included in the array. For 阅读全文
摘要:
/** * 112. Path Sum * https://leetcode.com/problems/path-sum/description/ * * Given a binary tree and a sum, * determine if the tree has a root-to-lea 阅读全文
摘要:
import java.util.* import kotlin.collections.ArrayList /** * Lock by leetcode * 272. Closest Binary Search Tree Value II * https://www.lintcode.com/pr 阅读全文
摘要:
什么是最小生成树? 一个有n个结点的连通图的生成树是原图的极小连通子图,且包含原图中的所有n个结点,并且有保持图连通的最少的边。最小生成树可以用Kruskal算法或Prim算法求出。 在一给定的无向图g=(V,E)中,(u,v)代表连接顶点u与顶点v的边,而w(u,v)代表此边的权重,若存在T为E 阅读全文
摘要:
import java.util.* import kotlin.collections.ArrayList /** * 373. Find K Pairs with Smallest Sums * https://leetcode.com/problems/find-k-pairs-with-sm 阅读全文
摘要:
/**Given a string, determine if a permutation of the string could form a palindrome. Example Input: s = "code" Output: False Input: s = "carerac" Output: True Explanation: "carerac" --> "carerac"... 阅读全文
摘要:
/** * 53. Maximum Subarray * https://leetcode.com/problems/maximum-subarray/description/ * https://www.cnblogs.com/grandyang/p/4377150.html * Given an integer array nums, * find the contiguous subarra 阅读全文