摘要:
链接:https://leetcode-cn.com/problems/permutation-sequence/ 代码 class Solution { public: string getPermutation(int n, int k) { string ans; vector<bool> s 阅读全文
posted @ 2020-07-07 18:03
景云ⁿ
阅读(66)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/spiral-matrix-ii/ 代码 class Solution { public: vector<vector<int>> generateMatrix(int n) { vector<vector<int>> ans( 阅读全文
posted @ 2020-07-07 17:29
景云ⁿ
阅读(108)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/length-of-last-word/ 代码 class Solution { public: int lengthOfLastWord(string s) { int ans = 0, last = 0; for (int 阅读全文
posted @ 2020-07-07 17:13
景云ⁿ
阅读(67)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/insert-interval/ 代码 class Solution { public: vector<vector<int>> insert(vector<vector<int>>& a, vector<int>& b) { 阅读全文
posted @ 2020-07-07 17:05
景云ⁿ
阅读(58)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/merge-intervals/ 代码 class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { vector<ve 阅读全文
posted @ 2020-07-07 09:33
景云ⁿ
阅读(57)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/n-queens-ii/ 代码 class Solution { public: vector<bool> col, dg, udg; int ans, N; int totalNQueens(int n) { N = n; c 阅读全文
posted @ 2020-07-07 09:22
景云ⁿ
阅读(54)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/n-queens/ 代码 class Solution { public: int N; vector<bool> col, dg, udg; vector<vector<string>> ans; vector<string> 阅读全文
posted @ 2020-07-07 09:14
景云ⁿ
阅读(65)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/jump-game-ii/ 代码 class Solution { public: int jump(vector<int>& nums) { int n = nums.size(); vector<int> f(n); for 阅读全文
posted @ 2020-07-07 08:57
景云ⁿ
阅读(52)
评论(0)
推荐(0)

浙公网安备 33010602011771号