jianzhi-Offer-Leetcode icon indicating copy to clipboard operation
jianzhi-Offer-Leetcode copied to clipboard

对一些题目的补充

Open u5n opened this issue 4 years ago • 0 comments

3-1题 和leetcode#287相似, 3-2题就是leetcode#287

书上用的cycle sort算法, 但是最优解还是cycle detection算法, #287的最优解可以沿用

47题基本对应64. Minimum Path Sum

https://leetcode.com/problems/minimum-path-sum/ 把最大改成最小就是一样的题目了 解法都是bellman-ford+拓扑排序求最短路的解法(表现为一个二维dp) 求最大把边取反即可

65题是371. Sum of Two Integers

66题是238. Product of Array Except Self

u5n avatar Jun 09 '21 20:06 u5n