leetcode 316. 去除重复字母 ——去重

摘要: #include <iostream> #include <vector> #include <queue> #include <algorithm> #include <string> using namespace std; class Solution { public: string rem 阅读全文
posted @ 2021-01-27 16:52 平ping 阅读(77) 评论(0) 推荐(0)

双指针——leetcode15——三数之和

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; /*原理:双指针法 先将数组排序! 设定一个 p ,然后设定左指针 L = p + 1 ,右指针 R = size - 1 ; 要逼近的数是 阅读全文
posted @ 2021-01-18 23:13 平ping 阅读(79) 评论(0) 推荐(0)

leetcode746——爬楼梯——动态规划

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; //原理:动态规划法 //到达每个阶梯都有一个理论上的最小体力minCost,按照minCost[i] = min(minCost[i-2] 阅读全文
posted @ 2021-01-18 22:14 平ping 阅读(41) 评论(0) 推荐(0)

八皇后——回溯法

摘要: 1 #include <iostream> 2 #include <vector> 3 #include <string> 4 #include <queue> 5 #include <stack> 6 #include <algorithm> 7 using namespace std; 8 9 阅读全文
posted @ 2021-01-18 21:10 平ping 阅读(64) 评论(0) 推荐(0)