摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
When runs "serverless create_domain", we may get the following error: Could not find the certificate xxxx.com. at ServerlessCustomDomain. This indicat 阅读全文
摘要:
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 阅读全文
摘要:
For some fixed , an array is beautiful if it is a permutation of the integers , such that: For every `i 这道题定义了一种漂亮数组,说的是在任意两个数字之间,不存在一个正好是这两个数之和的一半的数字 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
(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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Given an integer array , and an integer , return the number of tuples such that `i 这道题是之前那道 "3Sum" 的拓展,之前那道题是说没有重复数字,而这道题却有大量的重复数字,所以每个组合可能会大量重复出现,让我们 阅读全文
摘要:
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, 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 这道题给了一个正 阅读全文
摘要:
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 阅读全文
摘要:
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. 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Given an array of integers , sort the array in ascending order. Example 1: Example 2: Note: 1. `1 这道题让我们给数组排序,在平时刷其他题的时候,遇到要排序的时候,一般都会调用系统自带的排序函数,像 C+ 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文