3200. 三角形的最大高度 Maximum Height of a Triangle 力扣每日一题 LeetCode 题解 [模拟算法 枚举 暴力枚举] 03:26 3164. 优质数对的总数 II Find the Number of Good Pairs II 力扣每日一题 LeetCode 题解 [哈希表 调和级数] 07:15 3171. 找到按位或最接近 K 的子数组 力扣 LeetCode 题解 每日...
0105-construct-binary-tree-from-preorder-and-inorder-traversal.cpp 0110-balanced-binary-tree.cpp 0111-minimum-depth-of-binary-tree.cpp 0115-distinct-subsequences.cpp 0116-populating-next-right-pointers-in-each-node.cpp 0117-populating-next-right-pointers-in-each-node-ii.cpp 0118-pascals-triangl...
For two sum, we can sort the array and scan from two ends. Then space O(1), time O(nlogn) For here, it only accepts index. So we cant sort it as the index will change. Use hash table to record it. Then space O(n), time O(n) 1classSolution {2public:3vector<int> twoSum(...
0108-convert-sorted-array-to-binary-search-tree.go 0110-balanced-binary-tree.go 0112-path-sum.go 0116-populating-next-right-pointers-in-each-node.go 0118-pascals-triangle.go 0121-best-time-to-buy-and-sell-stock.go 0122-best-time-to-buy-and-sell-stock-ii.go 0124-binary-tree-maximum-path...
LeetCode <dp>120&931 Triangle&Minimum Falling Path Sum 其他 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. 大学里的混子 2018/11/15 3840 【DP】931. Minimum Falling Path Sum 编程算法 Given a square array of...
t.left=makeBinaryTreeByArray(array,index*2); t.right=makeBinaryTreeByArray(array,index*2+1); return t; // } } return null; } 2.递归的方式深度优先遍历二叉树并求和: 从root节点开始,调用sumNumbers(),首先将root的值计入变量tmpsum。
0105-construct-binary-tree-from-preorder-and-inorder-traversal.cpp 0110-balanced-binary-tree.cpp 0111-minimum-depth-of-binary-tree.cpp 0115-distinct-subsequences.cpp 0116-populating-next-right-pointers-in-each-node.cpp 0117-populating-next-right-pointers-in-each-node-ii.cpp 0118-pascals-triangle....