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

2021年2月28日

Sword 53-II

摘要: https://leetcode-cn.com/problems/que-shi-de-shu-zi-lcof/ 是上题的一个子模块的变形 判定条件由原来的大小关系,变为是否相等 稍微修改代码即可 阅读全文

posted @ 2021-02-28 13:59 FriskyPuppy 阅读(20) 评论(0) 推荐(0) 编辑

Sword 53-I

摘要: https://leetcode-cn.com/problems/zai-pai-xu-shu-zu-zhong-cha-zhao-shu-zi-lcof/solution/ 由于是有序数组,所有二分找左界线和右界限。 while i <= j, 最终会在j < i 的时候停下来,所以是可以遍历到整 阅读全文

posted @ 2021-02-28 13:45 FriskyPuppy 阅读(19) 评论(0) 推荐(0) 编辑

2020年5月25日

lc 最大正方形

摘要: 链接:https://leetcode-cn.com/problems/maximal-square/ 代码: class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: m = len(matrix) if m 阅读全文

posted @ 2020-05-25 01:05 FriskyPuppy 阅读(112) 评论(0) 推荐(0) 编辑

lc 二叉树的锯齿形层次遍历

摘要: 链接:https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/ 代码: /** * Definition for a binary tree node. * struct TreeNode { * int v 阅读全文

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

lc 二叉树的最近公共祖先

摘要: 链接:https://leetcode-cn.com/submissions/detail/73071277/ 代码: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; 阅读全文

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

lc 合并K个排序链表

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

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

lc 相交链表

摘要: 链接:https://leetcode-cn.com/problems/intersection-of-two-linked-lists/ 代码: # Definition for singly-linked list. # class ListNode(object): # def __init_ 阅读全文

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

lc 环形链表 II

摘要: 链接:https://leetcode-cn.com/problems/linked-list-cycle-ii/ 代码: # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): 阅读全文

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

2020年5月24日

lc 排序链表

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

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

lc 两数相加

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

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

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

导航