摘要: 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: [4,9] Exam 阅读全文
posted @ 2018-10-11 19:17 一丝清风一抹红尘 阅读(77) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2018-10-11 18:46 一丝清风一抹红尘 阅读(109) 评论(0) 推荐(0) 编辑
摘要: In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g 阅读全文
posted @ 2018-10-11 18:14 一丝清风一抹红尘 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Example 2: Note:Your 阅读全文
posted @ 2018-10-11 17:58 一丝清风一抹红尘 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d 阅读全文
posted @ 2018-10-11 17:21 一丝清风一抹红尘 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文
posted @ 2018-10-11 17:00 一丝清风一抹红尘 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2018-10-11 15:34 一丝清风一抹红尘 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Example 2: Note:You may assume the string contains only 阅读全文
posted @ 2018-10-11 15:25 一丝清风一抹红尘 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], wh 阅读全文
posted @ 2018-10-11 15:11 一丝清风一抹红尘 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文
posted @ 2018-10-11 14:45 一丝清风一抹红尘 阅读(98) 评论(0) 推荐(0) 编辑