454. 4Sum II 解题记录
摘要:题目描述: Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero. To ma
阅读全文
posted @
2018-11-10 21:16
宵夜在哪
阅读(109)
推荐(0)
98. Validate Binary Search Tree 解题记录
摘要:题目描述: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contain
阅读全文
posted @
2018-04-18 23:06
宵夜在哪
阅读(121)
推荐(0)
93. Restore IP Addresses 解题思路
摘要:题目描述: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", ret
阅读全文
posted @
2018-04-17 16:30
宵夜在哪
阅读(107)
推荐(0)
96. Unique Binary Search Trees 解题记录
摘要:题目描述: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 uniq
阅读全文
posted @
2018-04-16 09:14
宵夜在哪
阅读(85)
推荐(0)
95. Unique Binary Search Trees II 解题记录
摘要:题目描述: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program
阅读全文
posted @
2018-04-15 09:37
宵夜在哪
阅读(123)
推荐(0)
71. Simplify Path 解题记录
摘要:题目描述: Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" Corner C
阅读全文
posted @
2018-04-14 22:33
宵夜在哪
阅读(91)
推荐(0)
260. Single Number III 解题记录
摘要:题目描述: Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two ele
阅读全文
posted @
2018-04-13 19:53
宵夜在哪
阅读(86)
推荐(0)
300. Longest Increasing Subsequence 解题记录
摘要:题目描述: Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The lon
阅读全文
posted @
2018-04-12 23:33
宵夜在哪
阅读(115)
推荐(0)
238. Product of Array Except Self 解题记录
摘要:题目描述: 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 e
阅读全文
posted @
2018-04-11 19:04
宵夜在哪
阅读(93)
推荐(0)
152. Maximum Product Subarray 解题记录
摘要:题目描述: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-
阅读全文
posted @
2018-04-10 21:46
宵夜在哪
阅读(118)
推荐(0)
216. Combination Sum III 解题记录
摘要:题目描述: 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 shou
阅读全文
posted @
2018-04-08 23:42
宵夜在哪
阅读(115)
推荐(0)
215. Kth Largest Element in an Array 解题记录
摘要:题目描述: 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. Fo
阅读全文
posted @
2018-04-07 22:49
宵夜在哪
阅读(79)
推荐(0)
209. Minimum Size Subarray Sum 解题记录
摘要:题目描述: 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
阅读全文
posted @
2018-04-06 12:09
宵夜在哪
阅读(101)
推荐(0)
201. Bitwise AND of Numbers Range 解题记录
摘要:题目描述: Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the ran
阅读全文
posted @
2018-04-05 12:22
宵夜在哪
阅读(117)
推荐(0)
179. Largest Number 解题记录
摘要:题目描述: Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest fo
阅读全文
posted @
2018-04-04 21:32
宵夜在哪
阅读(87)
推荐(0)
200. Number of Islands 解题记录
摘要:题目描述: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting a
阅读全文
posted @
2018-04-03 15:36
宵夜在哪
阅读(102)
推荐(0)
199. Binary Tree Right Side View 解题记录
摘要:题目描述: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. F
阅读全文
posted @
2018-04-02 08:39
宵夜在哪
阅读(99)
推荐(0)
162. Find Peak Element 解题记录
摘要:题目描述: A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return it
阅读全文
posted @
2018-04-01 18:29
宵夜在哪
阅读(82)
推荐(0)
153. Find Minimum in Rotated Sorted Array 解题记录
摘要:题目描述: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
阅读全文
posted @
2018-04-01 00:25
宵夜在哪
阅读(93)
推荐(0)
137. Single Number II 解题记录
摘要:题目描述: Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one. 解题思路: 这题还是用136也就
阅读全文
posted @
2018-03-30 23:38
宵夜在哪
阅读(103)
推荐(0)