代码随想录算法训练营第四十一天 | 343.整数拆分、96. 不同的二叉搜索树。-爱代码爱编程
Leetcode 343.整数拆分 题目链接:343.整数拆分 class Solution { public: int integerBreak(int n) { vector<int&g
代码编织梦想
Leetcode 343.整数拆分 题目链接:343.整数拆分 class Solution { public: int integerBreak(int n) { vector<int&g
Leetcode 509. 斐波那契数 题目链接:509. 斐波那契数 class Solution { public: int fib(int n) { if(n <= 1)
Leetcode 738. 单调递增的数字 代码链接:738. 单调递增的数字 class Solution { public: int monotoneIncreasingDigits(int n) {
Leetcode 122. 买卖股票的最佳时机 II 题目链接:122. 买卖股票的最佳时机 II class Solution { public: int maxProfit(vector<int>
LeetCode 491. 递增子序列 题目链接 491. 递增子序列 class Solution { private: vector<vector<int>> result;
Leetcode 332. 重新安排行程 题目链接:332. 重新安排行程 class Solution { private: unordered_map<string,map<string,int&
LeetCode 93. 复原 IP 地址 题目链接 93. 复原 IP 地址 class Solution { private: vector<string> result; bool is
LeetCode 39. 组合总和 题目链接 39. 组合总和 class Solution { private: vector<vector<int>> result; vect
LeetCode 216. 组合总和 III 题目链接 216. 组合总和 III class Solution { private: vector<vector<int>> result
Leetcode 77. 组合 题目链接: 77. 组合 class Solution { private: vector<vector<int>> result; vector&
LeetCode 669. 修剪二叉搜索树 题目链接 669. 修剪二叉搜索树 /** * Definition for a binary tree node. * struct TreeNode { *
LeetCode 530 二叉搜索树的最小绝对差 题目链接 530.二叉搜索树的最小绝对差 /** * Definition for a binary tree node. * struct TreeNode {
LeetCode 513 找树左下角的值 题目链接 513. 找树左下角的值 /** * Definition for a binary tree node. * struct TreeNode { * i
LeetCode 654 最大二叉树 题目链接 654. 最大二叉树 /** * Definition for a binary tree node. * struct TreeNode { * int v
LeetCode 104 二叉树的最大深度 (优先掌握递归) 题目链接 104.二叉树的最大深度 (优先掌握递归) /** * Definition for a binary tree node. * struct
LeetCode 144 二叉树的前序遍历 题目链接 144. 二叉树的前序遍历 /** * Definition for a binary tree node. * struct TreeNode { *
LeetCode 20 有效的括号 题目链接 20. 有效的括号 class Solution { public: bool isValid(string s) { if(s.size() % 2
LeetCode 344 反转字符串 题目链接 344.反转字符串 class MyQueue { public: stack<int> stIn; stack<int> stOu
LeetCode 344 反转字符串 题目链接 344.反转字符串 class Solution { public: void reverseString(vector<char>& s) {
LeetCode 24 两两交换链表中的节点 题目链接 24.两两交换链表中的节点 class Solution { public: ListNode* swapPairs(ListNode* head) {