07 2017 档案
摘要:题目: 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
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: 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"]. 链
阅读全文
摘要:题目: Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operato
阅读全文
摘要: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
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For
阅读全文
摘要:题目: Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so
阅读全文
摘要:题目: Design a data structure that supports the following two operations: search(word) can search a literal word or a regular expression string containi
阅读全文
摘要:题目: Implement a trie with insert, search, and startsWith methods. 链接: http://leetcode.com/problems/implement-trie-prefix-tree/ 7/14/201760%,照着课件代码改写的。
阅读全文
摘要:题目: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you ha
阅读全文
摘要:Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't
阅读全文
摘要:自己的理解,更全面的需要额外查。 class可以implements Comprable interface,此class也必须有compareTo method,Comparable必须作用在compatible的数据上,否则compareTo会throw ClassCastException。C
阅读全文
浙公网安备 33010602011771号