随笔分类 -  LeetCode

上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 61 下一页
摘要: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 阅读(12276) 评论(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 阅读(4956) 评论(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 阅读(5496) 评论(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 阅读(11902) 评论(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 阅读(5966) 评论(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 阅读(14342) 评论(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 阅读(15865) 评论(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 阅读(7125) 评论(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 阅读(10159) 评论(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 阅读(5613) 评论(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 阅读(9574) 评论(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 阅读(8587) 评论(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 阅读(5655) 评论(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 阅读(4551) 评论(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 阅读(17455) 评论(13) 推荐(1) 编辑
摘要:Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2017-10-24 12:39 Grandyang 阅读(8575) 评论(1) 推荐(1) 编辑
摘要:Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th 阅读全文
posted @ 2017-10-23 12:25 Grandyang 阅读(6226) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2017-10-22 23:51 Grandyang 阅读(9769) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2017-10-20 11:53 Grandyang 阅读(17106) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Input: 5 O 阅读全文
posted @ 2017-10-19 23:51 Grandyang 阅读(3985) 评论(2) 推荐(1) 编辑

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