随笔分类 -  LeetCode

上一页 1 ··· 3 4 5 6 7 8 下一页
摘要:Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2018-12-22 06:01 Review->Improve 阅读(307) 评论(0) 推荐(0)
摘要:Implement a trie with insert, search, and startsWith methods. Notice You may assume that all inputs are consist of lowercase letters a-z. Implement a 阅读全文
posted @ 2018-12-15 05:59 Review->Improve 阅读(239) 评论(0) 推荐(0)
摘要:Given an array of integers A with even length, return true if and only if it is possible to reorder it such that A[2 * i + 1] = 2 * A[2 * i] for every 阅读全文
posted @ 2018-12-10 14:22 Review->Improve 阅读(592) 评论(0) 推荐(0)
摘要:Given a string, find the length of the longest substring T that contains at most k distinct characters. Example 1: Input: s = "eceba", k = 2 Output: 3 阅读全文
posted @ 2018-12-10 12:11 Review->Improve 阅读(3095) 评论(0) 推荐(0)
摘要:Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except n 阅读全文
posted @ 2018-11-30 00:18 Review->Improve 阅读(169) 评论(0) 推荐(0)
摘要:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2018-11-11 01:30 Review->Improve 阅读(132) 评论(0) 推荐(0)
摘要:Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2018-11-10 01:59 Review->Improve 阅读(351) 评论(0) 推荐(0)
摘要:A quadtree is a tree data in which each internal node has exactly four children: topLeft, topRight, bottomLeft and bottomRight. Quad trees are often u 阅读全文
posted @ 2018-11-08 00:39 Review->Improve 阅读(642) 评论(0) 推荐(0)
摘要: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 @ 2018-11-06 23:59 Review->Improve 阅读(183) 评论(0) 推荐(0)
摘要:Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or  阅读全文
posted @ 2017-11-12 13:21 Review->Improve 阅读(211) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2017-09-05 12:37 Review->Improve 阅读(308) 评论(0) 推荐(0)
摘要:Given an array of length n that stores a stock's price in n consecutive days, Buy/Sell stock with at most K transactions to maximize profit. You must 阅读全文
posted @ 2017-08-29 13:45 Review->Improve 阅读(432) 评论(0) 推荐(0)
摘要:Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elemen 阅读全文
posted @ 2017-08-29 13:35 Review->Improve 阅读(350) 评论(0) 推荐(0)
摘要:Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including 阅读全文
posted @ 2017-08-29 10:47 Review->Improve 阅读(254) 评论(0) 推荐(0)
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2017-08-28 09:09 Review->Improve 阅读(458) 评论(0) 推荐(0)
摘要:Given a sequence of words, and a limit on the number of characters that can be put in one line(line width). Put line breaks in the given sequence such 阅读全文
posted @ 2017-08-26 02:51 Review->Improve 阅读(240) 评论(0) 推荐(0)
摘要:Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from t 阅读全文
posted @ 2017-08-24 06:36 Review->Improve 阅读(182) 评论(0) 推荐(0)
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given the following mat 阅读全文
posted @ 2017-08-19 07:27 Review->Improve 阅读(227) 评论(0) 推荐(0)
摘要:Given certain jobs with start and end time and amount you make on finishing the job, find the maximum value you can make by scheduling jobs in non-ove 阅读全文
posted @ 2017-08-18 05:00 Review->Improve 阅读(1441) 评论(0) 推荐(0)
摘要:Given a string s and a dictionary of words dict, determine if s can be break into a space-separated sequence of one or more dictionary words. Example 阅读全文
posted @ 2017-08-01 15:36 Review->Improve 阅读(361) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 下一页