随笔分类 -  LeetCode

上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 61 下一页
摘要:You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map: 0 represents the obstacl 阅读全文
posted @ 2018-01-29 21:13 Grandyang 阅读(5352) 评论(1) 推荐(0)
摘要:Nearly everyone has used the Multiplication Table. The multiplication table of size m x n is an integer matrix mat where mat[i][j] == i * j (1-indexed 阅读全文
posted @ 2018-01-27 22:38 Grandyang 阅读(5070) 评论(7) 推荐(0)
摘要:On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y 阅读全文
posted @ 2018-01-24 22:27 Grandyang 阅读(10209) 评论(4) 推荐(1)
摘要:Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will ret 阅读全文
posted @ 2018-01-22 23:18 Grandyang 阅读(5385) 评论(1) 推荐(0)
摘要:There is a strange printer with the following two special requirements: The printer can only print a sequence of the same character each time. At each 阅读全文
posted @ 2018-01-20 09:44 Grandyang 阅读(5849) 评论(0) 推荐(0)
摘要:Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t 阅读全文
posted @ 2018-01-14 23:58 Grandyang 阅读(4033) 评论(0) 推荐(0)
摘要:There are N network nodes, labelled 1 to N. Given times, a list of travel times as directededges times[i] = (u, v, w), where u is the source node, v i 阅读全文
posted @ 2018-01-12 23:52 Grandyang 阅读(11732) 评论(8) 推荐(0)
摘要:Start from integer 1, remove any integer that contains 9 such as 9, 19, 29... So now, you will have a new integer sequence: 1, 2, 3, 4, 5, 6, 7, 8, 10 阅读全文
posted @ 2018-01-10 23:13 Grandyang 阅读(3273) 评论(14) 推荐(0)
摘要:Given a binary tree where every node has a unique value, and a target key k, find the value of the nearest leaf node to target k in the tree. Here, ne 阅读全文
posted @ 2018-01-08 23:46 Grandyang 阅读(6214) 评论(3) 推荐(0)
摘要:In a N x N grid representing a field of cherries, each cell is one of three possible integers. 0 means the cell is empty, so you can pass through; 1 m 阅读全文
posted @ 2018-01-06 23:58 Grandyang 阅读(10558) 评论(1) 推荐(0)
摘要:Given an array A (index starts at 1) consisting of N integers: A1, A2, ..., AN and an integer B. The integer Bdenotes that from any place (suppose the 阅读全文
posted @ 2018-01-03 14:03 Grandyang 阅读(5532) 评论(1) 推荐(0)
摘要:Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] and delete it to earn nums[i] points 阅读全文
posted @ 2018-01-02 14:00 Grandyang 阅读(7026) 评论(0) 推荐(0)
摘要:Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temp 阅读全文
posted @ 2017-12-24 10:37 Grandyang 阅读(11079) 评论(5) 推荐(0)
摘要:Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has m 阅读全文
posted @ 2017-12-19 23:43 Grandyang 阅读(5029) 评论(2) 推荐(0)
摘要:Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s 阅读全文
posted @ 2017-12-17 23:49 Grandyang 阅读(6810) 评论(0) 推荐(0)
摘要:You are given a string expression representing a Lisp-like expression to return the integer value of. The syntax for these expressions is given as fol 阅读全文
posted @ 2017-12-15 23:48 Grandyang 阅读(4874) 评论(1) 推荐(0)
摘要:We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign r 阅读全文
posted @ 2017-12-13 23:41 Grandyang 阅读(5629) 评论(0) 推荐(1)
摘要:Given an array consisting of n integers, find the contiguous subarray whose length is greater than or equal to k that has the maximum average value. A 阅读全文
posted @ 2017-12-11 06:41 Grandyang 阅读(12410) 评论(0) 推荐(1)
摘要:Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s 阅读全文
posted @ 2017-12-10 09:42 Grandyang 阅读(6585) 评论(0) 推荐(0)
摘要:Implement a MyCalendarThree class to store your events. A new event can always be added. Your class will have one method, book(int start, int end). Fo 阅读全文
posted @ 2017-12-08 13:53 Grandyang 阅读(5063) 评论(1) 推荐(1)

上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 61 下一页
Fork me on GitHub