上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 44 下一页
摘要: Given an array of integers, return if and only if it is a valid mountain array . Recall that A is a mountain array if and only if: There exists some w 阅读全文
posted @ 2020-04-27 07:19 Grandyang 阅读(1511) 评论(0) 推荐(1) 编辑
摘要: Given a string , count the number of distinct, non empty subsequences of . Since the result may be large, return the answer modulo . Example 1: Exampl 阅读全文
posted @ 2020-04-20 06:23 Grandyang 阅读(4623) 评论(0) 推荐(0) 编辑
摘要: Given a set of points in the xy plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes. If 阅读全文
posted @ 2020-04-13 06:26 Grandyang 阅读(3702) 评论(1) 推荐(0) 编辑
摘要: Given the node of a binary search tree, return the sum of values of all nodes with value between and (inclusive). The binary search tree is guaranteed 阅读全文
posted @ 2020-04-06 07:41 Grandyang 阅读(3405) 评论(0) 推荐(0) 编辑
摘要: You have an array of . Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier . Then, e 阅读全文
posted @ 2020-03-30 07:45 Grandyang 阅读(3019) 评论(0) 推荐(0) 编辑
摘要: You want to form a string of lowercase letters. At the beginning, your sequence is `'?' stamp` of lowercase letters. On each turn, you may place the s 阅读全文
posted @ 2020-03-16 07:43 Grandyang 阅读(2276) 评论(1) 推荐(1) 编辑
摘要: The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square ver 阅读全文
posted @ 2020-03-02 07:49 Grandyang 阅读(2724) 评论(1) 推荐(0) 编辑
摘要: 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 阅读(2047) 评论(0) 推荐(0) 编辑
摘要: When runs "serverless create_domain", we may get the following error: Could not find the certificate xxxx.com. at ServerlessCustomDomain. This indicat 阅读全文
posted @ 2020-02-20 14:49 Grandyang 阅读(5560) 评论(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 阅读(4112) 评论(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 阅读(3813) 评论(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 阅读(2169) 评论(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 阅读(2450) 评论(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 阅读(1634) 评论(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 阅读(1295) 评论(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 阅读(1869) 评论(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 阅读(2824) 评论(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 阅读(1695) 评论(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 阅读(2257) 评论(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 阅读(2775) 评论(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 阅读(1541) 评论(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 阅读(2293) 评论(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 阅读(2309) 评论(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 阅读(5132) 评论(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 阅读(5160) 评论(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 阅读(2290) 评论(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 阅读(3721) 评论(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 阅读(2535) 评论(0) 推荐(0) 编辑
摘要: Let's define a function that returns the number of unique characters on , for example if then , ,`"C" "O" "D" s`, therefore . On this problem given a 阅读全文
posted @ 2019-10-01 23:36 Grandyang 阅读(3386) 评论(0) 推荐(0) 编辑
摘要: Given an array , partition it into two (contiguous) subarrays and so that: Every element in is less than or equal to every element in . and are non em 阅读全文
posted @ 2019-09-29 23:25 Grandyang 阅读(2064) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer , how many ways can we write it as a sum of consecutive positive integers? Example 1: Example 2: Example 3: Note: `1 这道题给了一个正 阅读全文
posted @ 2019-09-26 23:54 Grandyang 阅读(3848) 评论(2) 推荐(0) 编辑
摘要: In a deck of cards, each card has an integer written on it. Return if and only if you can choose such that it is possible to split the entire deck int 阅读全文
posted @ 2019-09-23 23:20 Grandyang 阅读(2469) 评论(0) 推荐(0) 编辑
摘要: An undirected, connected tree with N nodes labelled 0...N-1 and N-1 edges are given. The ith edge connects nodes edges[i][0] and edges[i][1] together. 阅读全文
posted @ 2019-09-14 23:46 Grandyang 阅读(5136) 评论(1) 推荐(2) 编辑
摘要: A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as follows: is a list of all nodes such 阅读全文
posted @ 2019-09-12 23:55 Grandyang 阅读(4315) 评论(4) 推荐(0) 编辑
摘要: Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that it equals Y. For example, "tars" and "rats" are simi 阅读全文
posted @ 2019-09-10 22:14 Grandyang 阅读(3256) 评论(5) 推荐(0) 编辑
摘要: Given an array of integers , sort the array in ascending order. Example 1: Example 2: Note: 1. `1 这道题让我们给数组排序,在平时刷其他题的时候,遇到要排序的时候,一般都会调用系统自带的排序函数,像 C+ 阅读全文
posted @ 2019-09-07 23:52 Grandyang 阅读(5100) 评论(1) 推荐(0) 编辑
摘要: This problem is an interactive problem new to the LeetCode platform. We are given a word list of unique words, each word is 6 letters long, and one wo 阅读全文
posted @ 2019-09-02 21:45 Grandyang 阅读(6492) 评论(0) 推荐(0) 编辑
摘要: In an election, the th vote was cast for at time . Now, we would like to implement the following query function: will return the number of the person 阅读全文
posted @ 2019-08-27 23:48 Grandyang 阅读(2195) 评论(0) 推荐(0) 编辑
摘要: An undirected, connected graph of N nodes (labeled 0, 1, 2, ..., N-1) is given as graph. graph.length = N, and j != i is in the list graph[i] exactly 阅读全文
posted @ 2019-08-25 23:37 Grandyang 阅读(4065) 评论(2) 推荐(1) 编辑
摘要: Given a rooted binary tree, return the lowest common ancestor of its deepest leaves. Recall that: The node of a binary tree is a leaf if and only if i 阅读全文
posted @ 2019-08-22 22:39 Grandyang 阅读(2994) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 44 下一页
Fork me on GitHub