摘要: 1 """ 2 Given a binary tree with the following rules: 3 root.val == 0 4 If treeNode.val == x and treeNode.left != null, then treeNode.left.val == 2 * 阅读全文
posted @ 2020-02-08 20:02 yawenw 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree, return the sum of values of its deepest leaves. 3 Example 1: 4 Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8] 5 阅读全文
posted @ 2020-02-08 19:56 yawenw 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given two binary search trees root1 and root2. 3 Return a list containing all the integers from both trees sorted in ascending order. 4 Exampl 阅读全文
posted @ 2020-02-08 19:52 yawenw 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a linked list, remove the n-th node from the end of list and return its head. 3 Example: 4 Given linked list: 1->2->3->4->5, and n = 2. 阅读全文
posted @ 2020-02-07 19:45 yawenw 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 阅读全文
posted @ 2020-02-07 17:46 yawenw 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a sorted linked list, delete all duplicates such that each element appear only once. 3 Example 1: 4 Input: 1->1->2 5 Output: 1->2 6 Exam 阅读全文
posted @ 2020-02-07 17:43 yawenw 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a linked list, swap every two adjacent nodes and return its head. 3 You may not modify the values in the list's nodes, only nodes itself 阅读全文
posted @ 2020-02-07 17:39 yawenw 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their node 阅读全文
posted @ 2020-02-07 15:59 yawenw 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a collection of intervals, merge all overlapping intervals. 3 Example 1: 4 Input: [[1,3],[2,6],[8,10],[15,18]] 5 Output: [[1,6],[8,10],[ 阅读全文
posted @ 2020-02-06 21:49 yawenw 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Intersection of Two Arrays 3 Given two arrays, write a function to compute their intersection. 4 Example 1: 5 Input: nums1 = [1,2,2,1], nums2 阅读全文
posted @ 2020-02-06 21:47 yawenw 阅读(107) 评论(0) 推荐(0) 编辑