摘要: 题目描述: 方法一:排序输出中位数 class Solution(object): def majorityElement(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return None nums.sor 阅读全文
posted @ 2019-03-19 20:24 oldby 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法一:迭代 class Solution: def reverseList(self, head: ListNode) -> ListNode: pre = None cur = head while cur: tmp = cur.next cur.next = pre cur,pre 阅读全文
posted @ 2019-03-19 20:04 oldby 阅读(140) 评论(0) 推荐(0) 编辑