摘要: I2C universal transfer driver 一、背景 R818平台 ① 没有串口资源了,但是需要一个高速通信方式(相比串口而言) ② 并且尽可能减少使用的pin数,所以选择了i2c 由于想要尽可能跟串口通信很像,就选择了/dev下生成设备的方式,按理说可以用那个通用的i2c总线控制方 阅读全文
posted @ 2025-07-18 17:28 J&YANG 阅读(17) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/median-of-two-sorted-arrays/?envType=study-plan-v2&envId=top-interview-150】 一道困难题,常规思路不难,但是真的难写,边界要仔细思考。 下面是我第一轮的思路,虽 阅读全文
posted @ 2025-06-05 14:39 J&YANG 阅读(10) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/binary-tree-maximum-path-sum/description/?envType=study-plan-v2&envId=top-interview-150】 又一道困难题目,自行顺利解决,记录一下自己思路。 树形D 阅读全文
posted @ 2025-06-04 10:13 J&YANG 阅读(16) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/h-index/?envType=study-plan-v2&envId=top-interview-150】 其实就是理解成两个维度,找到两个维度在相互制衡情况下的公共最大值。 1 class Solution { 2 public 阅读全文
posted @ 2025-06-03 18:00 J&YANG 阅读(11) 评论(0) 推荐(0)
摘要: 力扣53. 最大子数组和:【https://leetcode.cn/problems/maximum-subarray/description/】 经典的dp + 空间优化,代码如下 1 class Solution { 2 public: 3 int maxSubArray(vector<int> 阅读全文
posted @ 2025-06-03 16:11 J&YANG 阅读(15) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/majority-element/?envType=study-plan-v2&envId=top-interview-150】 这个题目跟找数量最多的数字有区别,这里面的算法也属于单独适合这个题的算法。 通常来说,看到这种题目第一想 阅读全文
posted @ 2025-06-03 09:55 J&YANG 阅读(10) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/candy/description/?envType=study-plan-v2&envId=top-interview-150】 想了一个办法,依次向后遍历,遇到下降(不包含相等)的情况,就将其置为1,并且开始第二层循环,从当前位置 阅读全文
posted @ 2025-05-28 15:01 J&YANG 阅读(11) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/minimum-path-sum/description/?envType=study-plan-v2&envId=top-interview-150】 直接看出来是二维dp,压缩至一维存储,然后就通过了 1 #define NUM_ 阅读全文
posted @ 2025-05-27 10:25 J&YANG 阅读(11) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/jump-game-ii/?envType=study-plan-v2&envId=top-interview-150】 当时首先想到的是dp,也写出了一个dp算法,不过写的时候就知道,这个方法时间复杂度在最差的情况下,趋近于n的平方 阅读全文
posted @ 2025-05-26 14:23 J&YANG 阅读(15) 评论(0) 推荐(0)
摘要: 题目:【https://leetcode.cn/problems/jump-game/?envType=study-plan-v2&envId=top-interview-150】 比较容易想到的思路,记录一下 1 class Solution { 2 public: 3 bool canJump( 阅读全文
posted @ 2025-05-22 14:02 J&YANG 阅读(8) 评论(0) 推荐(0)