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 阅读(144) 评论(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 阅读(181) 评论(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 阅读(188) 评论(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 阅读(81) 评论(0) 推荐(0) 编辑

导航