随笔分类 -  LeetCode

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 61 下一页
摘要:Write a class to count recent requests. It has only one method: , where t represents some time in milliseconds. Return the number of s that have been 阅读全文
posted @ 2020-02-25 00:59 Grandyang 阅读(1990) 评论(0) 推荐(0) 编辑
摘要:In a given 2D binary array , there are two islands. (An island is a 4 directionally connected group of s not connected to any other 1s.) Now, we may c 阅读全文
posted @ 2020-02-19 23:28 Grandyang 阅读(4059) 评论(0) 推荐(0) 编辑
摘要:For some fixed , an array is beautiful if it is a permutation of the integers , such that: For every `i 这道题定义了一种漂亮数组,说的是在任意两个数字之间,不存在一个正好是这两个数之和的一半的数字 阅读全文
posted @ 2020-02-09 14:47 Grandyang 阅读(3764) 评论(1) 推荐(0) 编辑
摘要:Given an n x n array of integers matrix, return the minimum sum of any falling path through matrix. A falling path starts at any element in the first 阅读全文
posted @ 2020-02-06 14:44 Grandyang 阅读(2150) 评论(0) 推荐(0) 编辑
摘要:In an array A of 0s and 1s, how many non-empty subarrays have sum S? Example 1: Input: A = [1,0,1,0,1], S = 2 Output: 4 Explanation: The 4 subarrays a 阅读全文
posted @ 2020-01-31 14:30 Grandyang 阅读(2394) 评论(3) 推荐(1) 编辑
摘要:Every email consists of a local name and a domain name, separated by the @ sign. For example, in , is the local name, and is the domain name. Besides 阅读全文
posted @ 2020-01-27 04:39 Grandyang 阅读(1612) 评论(0) 推荐(1) 编辑
摘要:(This problem is the same as Minimize Malware Spread, with the differences bolded.) In a network of nodes, each node i is directly connected to anothe 阅读全文
posted @ 2020-01-22 14:10 Grandyang 阅读(1272) 评论(2) 推荐(0) 编辑
摘要:Given an array of s and s, divide the array into 3 non empty parts such that all of these parts represent the same binary value. If it is possible, re 阅读全文
posted @ 2019-12-27 14:24 Grandyang 阅读(1843) 评论(0) 推荐(1) 编辑
摘要:A string of s and s is monotone increasing if it consists of some number of s (possibly 0), followed by some number of s (also possibly 0.) We are giv 阅读全文
posted @ 2019-12-01 02:29 Grandyang 阅读(2800) 评论(0) 推荐(0) 编辑
摘要:Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 阅读全文
posted @ 2019-11-23 06:38 Grandyang 阅读(1680) 评论(2) 推荐(1) 编辑
摘要:In a network of nodes, each node is directly connected to another node if and only if . Some nodes are initially infected by malware. Whenever two nod 阅读全文
posted @ 2019-11-11 22:05 Grandyang 阅读(2216) 评论(0) 推荐(0) 编辑
摘要:Given an integer array , and an integer , return the number of tuples such that `i 这道题是之前那道 "3Sum" 的拓展,之前那道题是说没有重复数字,而这道题却有大量的重复数字,所以每个组合可能会大量重复出现,让我们 阅读全文
posted @ 2019-11-08 09:27 Grandyang 阅读(2747) 评论(0) 推荐(0) 编辑
摘要:Given an array of non negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever is odd, 阅读全文
posted @ 2019-11-05 02:02 Grandyang 阅读(1522) 评论(0) 推荐(1) 编辑
摘要:Given a string of and parentheses, we add the minimum number of parentheses ( or , and in any positions ) so that the resulting parentheses string is 阅读全文
posted @ 2019-10-31 04:28 Grandyang 阅读(2234) 评论(0) 推荐(0) 编辑
摘要:Your music player contains different songs and she wants to listen to (not necessarily different) songs during your trip. You create a playlist so tha 阅读全文
posted @ 2019-10-25 23:54 Grandyang 阅读(2277) 评论(2) 推荐(1) 编辑
摘要:A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possibl 阅读全文
posted @ 2019-10-23 23:55 Grandyang 阅读(5115) 评论(4) 推荐(0) 编辑
摘要:Given a circular array C of integers represented by , find the maximum possible sum of a non empty subarray of C. Here, a circular array means the end 阅读全文
posted @ 2019-10-21 21:26 Grandyang 阅读(5065) 评论(2) 推荐(0) 编辑
摘要:Given a string , return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positio 阅读全文
posted @ 2019-10-18 23:43 Grandyang 阅读(2271) 评论(0) 推荐(1) 编辑
摘要:In a 2D grid of s and s, we change at most one to a . After, what is the size of the largest island? (An island is a 4 directionally connected group o 阅读全文
posted @ 2019-10-13 23:32 Grandyang 阅读(3660) 评论(2) 推荐(0) 编辑
摘要:We are given two arrays and of words. Each word is a string of lowercase letters. Now, say that word is a subset of word if every letter in occurs in 阅读全文
posted @ 2019-10-04 23:33 Grandyang 阅读(2518) 评论(0) 推荐(0) 编辑

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 61 下一页
Fork me on GitHub