摘要: 题目: Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums exc 阅读全文
posted @ 2017-07-25 20:06 panini 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ B 阅读全文
posted @ 2017-07-25 19:44 panini 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space 阅读全文
posted @ 2017-07-25 10:59 panini 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. 链 阅读全文
posted @ 2017-07-25 10:19 panini 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 题目: Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operato 阅读全文
posted @ 2017-07-24 11:01 panini 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner as s 阅读全文
posted @ 2017-07-20 19:34 panini 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary tree every level 阅读全文
posted @ 2017-07-20 11:06 panini 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given the following 阅读全文
posted @ 2017-07-20 10:21 panini 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums 阅读全文
posted @ 2017-07-18 11:00 panini 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 题目: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should 阅读全文
posted @ 2017-07-17 11:12 panini 阅读(262) 评论(0) 推荐(0) 编辑