随笔分类 -  LeetCode

上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 61 下一页
摘要: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 阅读(11229) 评论(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 阅读(8468) 评论(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 阅读(7571) 评论(9) 推荐(0)
摘要:Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking. Your class will have 阅读全文
posted @ 2017-11-29 14:14 Grandyang 阅读(7449) 评论(0) 推荐(1)
摘要:A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 阅读全文
posted @ 2017-11-27 23:55 Grandyang 阅读(4491) 评论(0) 推荐(0)
摘要:Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). For each 阅读全文
posted @ 2017-11-25 23:56 Grandyang 阅读(12460) 评论(4) 推荐(0)
摘要:Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The length of each 阅读全文
posted @ 2017-11-22 12:04 Grandyang 阅读(5104) 评论(1) 推荐(1)
摘要:Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文
posted @ 2017-11-20 12:08 Grandyang 阅读(5561) 评论(1) 推荐(0)
摘要:This question is about implementing a basic elimination algorithm for Candy Crush. Given a 2D integer array board representing the grid of candy, diff 阅读全文
posted @ 2017-11-18 23:40 Grandyang 阅读(12146) 评论(0) 推荐(1)
摘要:Given a C++ program, remove comments from it. The program source is an array where source[i] is the i-th line of the source code. This represents the 阅读全文
posted @ 2017-11-15 23:58 Grandyang 阅读(6084) 评论(0) 推荐(0)
摘要:Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements a 阅读全文
posted @ 2017-11-13 23:52 Grandyang 阅读(14918) 评论(2) 推荐(0)
摘要:Design a max stack that supports push, pop, top, peekMax and popMax. push(x) -- Push element x onto stack. pop() -- Remove the element on top of the s 阅读全文
posted @ 2017-11-12 22:56 Grandyang 阅读(16262) 评论(0) 推荐(0)
摘要:Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo 阅读全文
posted @ 2017-11-10 23:52 Grandyang 阅读(7201) 评论(0) 推荐(0)
摘要:Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays. Example 1: Input: A: [1,2,3,2,1] B: [3,2,1,4,7 阅读全文
posted @ 2017-11-07 22:37 Grandyang 阅读(10407) 评论(16) 推荐(0)
摘要:We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文
posted @ 2017-11-05 23:57 Grandyang 阅读(5672) 评论(0) 推荐(0)
摘要:Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee represen 阅读全文
posted @ 2017-11-03 10:29 Grandyang 阅读(9734) 评论(0) 推荐(1)
摘要:Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the product of all the elements in the s 阅读全文
posted @ 2017-10-30 12:32 Grandyang 阅读(8742) 评论(14) 推荐(1)
摘要:Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. Example 1: Input: s1 = "sea", s2 = "eat" Output: 阅读全文
posted @ 2017-10-29 23:50 Grandyang 阅读(5759) 评论(0) 推荐(1)
摘要:There are some trees, where each tree is represented by (x,y) coordinate in a two-dimensional garden. Your job is to fence the entire garden using the 阅读全文
posted @ 2017-10-27 23:54 Grandyang 阅读(4618) 评论(2) 推荐(0)
摘要:Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal. Ex 阅读全文
posted @ 2017-10-25 23:38 Grandyang 阅读(17762) 评论(13) 推荐(1)

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