上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 28 下一页
摘要: 链接: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 景云ⁿ 阅读(63) 评论(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 景云ⁿ 阅读(105) 评论(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 景云ⁿ 阅读(65) 评论(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 景云ⁿ 阅读(57) 评论(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 景云ⁿ 阅读(49) 评论(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 景云ⁿ 阅读(48) 评论(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 景云ⁿ 阅读(63) 评论(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 景云ⁿ 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/jump-game/ 代码 class Solution { public: bool canJump(vector<int>& nums) { for (int i = 0, j = 0; i < nums.size(); + 阅读全文
posted @ 2020-07-06 22:03 景云ⁿ 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/spiral-matrix/ 代码 class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int> ans; 阅读全文
posted @ 2020-07-06 21:48 景云ⁿ 阅读(119) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 28 下一页