摘要: Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2,2] Example 2: Input: n 阅读全文
posted @ 2018-09-04 14:22 轻风舞动 阅读(551) 评论(0) 推荐(0) 编辑
摘要: Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [9,4] Exam 阅读全文
posted @ 2018-09-04 14:00 轻风舞动 阅读(787) 评论(0) 推荐(0) 编辑
摘要: For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible roote 阅读全文
posted @ 2018-09-04 13:07 轻风舞动 阅读(729) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find all leaves and then remove those leaves. Then repeat the previous steps until the tree is empty. Example:Given binary tree R 阅读全文
posted @ 2018-09-04 12:52 轻风舞动 阅读(634) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and ri 阅读全文
posted @ 2018-09-04 12:40 轻风舞动 阅读(1386) 评论(0) 推荐(1) 编辑
摘要: Given an unsorted integer array, find the smallest missing positive integer. Example 1: Example 2: Example 3: Note: Your algorithm should run in O(n) 阅读全文
posted @ 2018-09-04 08:06 轻风舞动 阅读(242) 评论(0) 推荐(0) 编辑
摘要: A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. The world is modeled as a 2-D array of cells, wher 阅读全文
posted @ 2018-09-04 07:03 轻风舞动 阅读(633) 评论(0) 推荐(0) 编辑