随笔分类 -  LeetCode

上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 61 下一页
摘要: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 阅读(5324) 评论(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 阅读(5770) 评论(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 阅读(4006) 评论(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 阅读(11538) 评论(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 阅读(3208) 评论(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 阅读(6185) 评论(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 阅读(10461) 评论(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 阅读(5483) 评论(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 阅读(6970) 评论(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 阅读(10965) 评论(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 阅读(4931) 评论(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 阅读(6762) 评论(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 阅读(4835) 评论(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 阅读(5523) 评论(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 阅读(12196) 评论(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 阅读(6540) 评论(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 阅读(5024) 评论(1) 推荐(1) 编辑
摘要:An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, 阅读全文
posted @ 2017-12-05 23:23 Grandyang 阅读(11063) 评论(2) 推荐(0) 编辑
摘要:Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking. Your class will ha 阅读全文
posted @ 2017-12-03 23:50 Grandyang 阅读(8388) 评论(2) 推荐(1) 编辑
摘要:Given a string S, find the number of different non-empty palindromic subsequences in S, and return that number modulo 10^9 + 7. A subsequence of a str 阅读全文
posted @ 2017-12-01 14:13 Grandyang 阅读(7493) 评论(9) 推荐(0) 编辑

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