上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页

2020年5月24日

lc 反转链表

摘要: 链接:https://leetcode-cn.com/problems/reverse-linked-list/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; 阅读全文

posted @ 2020-05-24 23:22 FriskyPuppy 阅读(113) 评论(0) 推荐(0) 编辑

2020年5月23日

lc 搜索二维矩阵 II

摘要: 链接:https://leetcode-cn.com/problems/search-a-2d-matrix-ii/ 代码: class Solution(object): def searchMatrix(self, matrix, target): if len(matrix) == 0 or 阅读全文

posted @ 2020-05-23 00:25 FriskyPuppy 阅读(142) 评论(0) 推荐(0) 编辑

lc 合并两个有序链表

摘要: 链接:https://leetcode-cn.com/submissions/detail/72680216/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; 阅读全文

posted @ 2020-05-23 00:16 FriskyPuppy 阅读(79) 评论(0) 推荐(0) 编辑

lc 接雨水

摘要: 链接:https://leetcode-cn.com/problems/trapping-rain-water/ 代码: class Solution { public: int trap(vector<int>& height) { int n = height.size(); if(n == 0 阅读全文

posted @ 2020-05-23 00:14 FriskyPuppy 阅读(84) 评论(0) 推荐(0) 编辑

lc 合并区间

摘要: 链接:https://leetcode-cn.com/problems/merge-intervals/ 代码: class Solution { public: // [[2,3],[4,5],[6,7],[8,9],[1,10]] static bool myfunc(vector<int> i 阅读全文

posted @ 2020-05-23 00:06 FriskyPuppy 阅读(180) 评论(0) 推荐(0) 编辑

lc 朋友圈

摘要: 链接:https://leetcode-cn.com/problems/friend-circles/ 代码: class Solution { public: void solve(vector<vector<int>>& M, int * vis, int start) { if(vis[sta 阅读全文

posted @ 2020-05-23 00:04 FriskyPuppy 阅读(187) 评论(0) 推荐(0) 编辑

lc 第k个排列

摘要: 链接:https://leetcode-cn.com/problems/permutation-sequence/ 代码: class Solution { public: string getPermutation(int n, int k) { int table[11] = {0,1,2,6, 阅读全文

posted @ 2020-05-23 00:00 FriskyPuppy 阅读(80) 评论(0) 推荐(0) 编辑

2020年5月22日

lc 最长连续序列

摘要: 链接:https://leetcode-cn.com/problems/longest-consecutive-sequence/ 代码: class Solution { public: int longestConsecutive(vector<int>& nums) { int n = num 阅读全文

posted @ 2020-05-22 23:56 FriskyPuppy 阅读(198) 评论(0) 推荐(0) 编辑

lc 最长连续递增序列

摘要: 链接:https://leetcode-cn.com/problems/longest-continuous-increasing-subsequence/ 代码: class Solution { public: int findLengthOfLCIS(vector<int>& nums) { 阅读全文

posted @ 2020-05-22 23:52 FriskyPuppy 阅读(159) 评论(0) 推荐(0) 编辑

lc 搜索旋转排序数组

摘要: 链接:https://leetcode-cn.com/problems/search-in-rotated-sorted-array/ 代码: #include <algorithm> class Solution { public: int search(vector<int>& nums, in 阅读全文

posted @ 2020-05-22 23:50 FriskyPuppy 阅读(218) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页

导航