摘要: 题目描述: 方法:#在改pre链表时 head中的值也改变 class Solution(object): def removeElements(self, head, val): """ :type head: ListNode :type val: int :rtype: ListNode "" 阅读全文
posted @ 2019-03-18 21:33 oldby 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 方法一: class Solution(object): def getIntersectionNode(self, headA, headB): """ :type head1, head1: ListNode :rtype: ListNode """ a,b = headA,head 阅读全文
posted @ 2019-03-18 20:35 oldby 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 方法一: class Solution(object): def hasCycle(self, head): """ :type head: ListNode :rtype: bool """ while head: if head.val == "daafas": return Tru 阅读全文
posted @ 2019-03-18 19:45 oldby 阅读(632) 评论(0) 推荐(0) 编辑
摘要: https://mp.weixin.qq.com/s/jluii9YIvfhKd_tPecfTaw 阅读全文
posted @ 2019-03-18 14:41 oldby 阅读(546) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 第一次提交: class Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: j,x = 0,1 l = [] if matrix==[]: return [] m = len(matrix) n 阅读全文
posted @ 2019-03-18 14:14 oldby 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 参考后的提交: class Solution: def generateMatrix(self, n: int): #l = [[0] * n] * n 此创建方法错误 l = [[] for i in range(n)] for i in range(n): for j in rang 阅读全文
posted @ 2019-03-18 12:30 oldby 阅读(115) 评论(0) 推荐(0) 编辑