摘要: 第一题 题目链接:https://leetcode.cn/problems/n-ary-tree-preorder-traversal/ 个人题解:DFS 代码: class Solution { public: vector<int> res; vector<int> preorder(Node* 阅读全文
posted @ 2022-06-28 08:32 黑VS白-清墨 阅读(29) 评论(0) 推荐(0)
摘要: 第一题 题目链接:https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/ 个人题解:线性DP 代码: class Solution { public: int maxProfit(vector<int>& prices) { int 阅读全文
posted @ 2022-06-28 08:27 黑VS白-清墨 阅读(46) 评论(0) 推荐(0)