随笔分类 -  LeetCode

上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 61 下一页
摘要:In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o 阅读全文
posted @ 2016-11-26 07:00 Grandyang 阅读(17333) 评论(21) 推荐(0) 编辑
摘要:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
posted @ 2016-11-24 00:00 Grandyang 阅读(11645) 评论(0) 推荐(1) 编辑
摘要:Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected e 阅读全文
posted @ 2016-11-22 14:09 Grandyang 阅读(8587) 评论(2) 推荐(1) 编辑
摘要:Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2016-11-21 22:37 Grandyang 阅读(17166) 评论(9) 推荐(0) 编辑
摘要:Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th 阅读全文
posted @ 2016-11-20 00:58 Grandyang 阅读(19646) 评论(16) 推荐(0) 编辑
摘要:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g 阅读全文
posted @ 2016-11-18 13:02 Grandyang 阅读(7037) 评论(0) 推荐(2) 编辑
摘要: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 make pro 阅读全文
posted @ 2016-11-17 12:38 Grandyang 阅读(13821) 评论(4) 推荐(0) 编辑
摘要:A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2016-11-12 23:59 Grandyang 阅读(8524) 评论(9) 推荐(0) 编辑
摘要:Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n  阅读全文
posted @ 2016-11-11 12:42 Grandyang 阅读(12077) 评论(11) 推荐(0) 编辑
摘要:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor 阅读全文
posted @ 2016-11-10 13:24 Grandyang 阅读(9817) 评论(0) 推荐(2) 编辑
摘要: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 @ 2016-11-09 23:59 Grandyang 阅读(9992) 评论(6) 推荐(0) 编辑
摘要:Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers fr 阅读全文
posted @ 2016-11-05 10:01 Grandyang 阅读(15202) 评论(6) 推荐(1) 编辑
摘要:Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n. Note: 1 ≤ k ≤ n ≤ 109. Example: 这道题是之前那道Lexicograph 阅读全文
posted @ 2016-11-04 21:45 Grandyang 阅读(9496) 评论(2) 推荐(1) 编辑
摘要:You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number 阅读全文
posted @ 2016-11-03 12:22 Grandyang 阅读(9307) 评论(0) 推荐(2) 编辑
摘要:Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expre 阅读全文
posted @ 2016-11-02 12:20 Grandyang 阅读(7923) 评论(1) 推荐(0) 编辑
摘要:Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point o 阅读全文
posted @ 2016-11-01 10:46 Grandyang 阅读(7317) 评论(0) 推荐(1) 编辑
摘要:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note: You 阅读全文
posted @ 2016-10-31 21:56 Grandyang 阅读(15384) 评论(3) 推荐(1) 编辑
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
posted @ 2016-10-30 23:17 Grandyang 阅读(22758) 评论(13) 推荐(1) 编辑
摘要:Implement a data structure supporting the following operations: Challenge: Perform all these in O(1) time complexity. 这道题让我们实现一个全是O(1)复杂度的数据结构,包括了增加ke 阅读全文
posted @ 2016-10-29 23:51 Grandyang 阅读(11931) 评论(5) 推荐(0) 编辑
摘要:Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum. The 阅读全文
posted @ 2016-10-28 12:32 Grandyang 阅读(24785) 评论(19) 推荐(1) 编辑

上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 61 下一页
Fork me on GitHub