上一页 1 ··· 9 10 11 12 13 14 15 下一页
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2017-02-25 20:43 Tsunami_lj 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文
posted @ 2017-02-25 19:44 Tsunami_lj 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2017-02-25 16:24 Tsunami_lj 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the eleme 阅读全文
posted @ 2017-02-24 21:07 Tsunami_lj 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 假设我们已经知道数组左右两部分的逆序数对(记为inv1和inv2),我们在merge的过程中除了inv1+inv2之外,还需要计算merge过程总的逆序数对。 如何计算merge()? 在归并过程中,让i作为左边数组的遍历索引,j作为右边数组的遍历索引。在合并的过程中,如果a[i]>b[j],那么合 阅读全文
posted @ 2017-02-24 19:41 Tsunami_lj 阅读(1911) 评论(0) 推荐(0) 编辑
摘要: You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal 阅读全文
posted @ 2017-02-24 18:20 Tsunami_lj 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be for 阅读全文
posted @ 2017-02-24 15:10 Tsunami_lj 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: Note: You may assume the tree (i.e., the given root no 阅读全文
posted @ 2017-02-23 22:14 Tsunami_lj 阅读(113) 评论(0) 推荐(0) 编辑
摘要: You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the w 阅读全文
posted @ 2017-02-23 18:13 Tsunami_lj 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. For example, given the following 阅读全文
posted @ 2017-02-23 16:15 Tsunami_lj 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 下一页