随笔分类 -  LeetCode

上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 61 下一页
摘要:In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this word successor. For 阅读全文
posted @ 2017-08-24 15:39 Grandyang 阅读(6568) 评论(0) 推荐(0) 编辑
摘要:Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2017-08-21 15:44 Grandyang 阅读(17876) 评论(9) 推荐(0) 编辑
摘要:You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow an 阅读全文
posted @ 2017-08-17 14:51 Grandyang 阅读(5641) 评论(4) 推荐(0) 编辑
摘要:Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and i 阅读全文
posted @ 2017-08-12 16:02 Grandyang 阅读(7005) 评论(1) 推荐(0) 编辑
摘要:The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another n 阅读全文
posted @ 2017-08-09 11:17 Grandyang 阅读(5211) 评论(0) 推荐(1) 编辑
摘要:Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the 阅读全文
posted @ 2017-08-06 13:54 Grandyang 阅读(7667) 评论(0) 推荐(0) 编辑
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping way: Beyond that, now the encoded string can also contai 阅读全文
posted @ 2017-08-03 13:07 Grandyang 阅读(8187) 评论(4) 推荐(1) 编辑
摘要:In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or mo 阅读全文
posted @ 2017-07-31 10:05 Grandyang 阅读(7664) 评论(2) 推荐(0) 编辑
摘要:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Input: 3 / \ 9 20 / \ 15 7 Outp 阅读全文
posted @ 2017-07-30 15:08 Grandyang 阅读(5304) 评论(0) 推荐(0) 编辑
摘要:Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find the exclusive time of these functions. Each funct 阅读全文
posted @ 2017-07-27 14:42 Grandyang 阅读(8966) 评论(5) 推荐(0) 编辑
摘要:You are given several logs that each log contains a unique id and timestamp. Timestamp is a string that has the following format: Year:Month:Day:Hour: 阅读全文
posted @ 2017-07-23 14:01 Grandyang 阅读(11394) 评论(0) 推荐(0) 编辑
摘要:In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position. There's 阅读全文
posted @ 2017-07-20 14:05 Grandyang 阅读(4449) 评论(0) 推荐(0) 编辑
摘要:You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists. We define 阅读全文
posted @ 2017-07-18 13:26 Grandyang 阅读(9253) 评论(4) 推荐(2) 编辑
摘要:Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Example 2: 这道题让我们求一个数是否 阅读全文
posted @ 2017-07-16 14:43 Grandyang 阅读(7816) 评论(3) 推荐(2) 编辑
摘要:Your task is to design the basic function of Excel and implement the function of sum formula. Specifically, you need to implement the following functi 阅读全文
posted @ 2017-07-14 14:42 Grandyang 阅读(5800) 评论(7) 推荐(0) 编辑
摘要:Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha 阅读全文
posted @ 2017-07-10 06:53 Grandyang 阅读(8706) 评论(2) 推荐(1) 编辑
摘要:Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each process only has one parent process, but may have 阅读全文
posted @ 2017-07-10 06:48 Grandyang 阅读(8599) 评论(0) 推荐(1) 编辑
摘要:There are n different online courses numbered from 1 to n. Each course has some duration(course length) tand closed on dth day. A course should be tak 阅读全文
posted @ 2017-07-06 14:44 Grandyang 阅读(7945) 评论(3) 推荐(2) 编辑
摘要:Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. We define an in 阅读全文
posted @ 2017-07-03 15:33 Grandyang 阅读(6385) 评论(2) 推荐(1) 编辑
摘要:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could 阅读全文
posted @ 2017-06-30 14:43 Grandyang 阅读(33166) 评论(16) 推荐(2) 编辑

上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 61 下一页
Fork me on GitHub