上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 44 下一页
摘要: You are given the root of a binary tree with n nodes where each node in the tree has node.val coins and there are n coins total. In one move, we may c 阅读全文
posted @ 2020-12-25 13:09 Grandyang 阅读(1827) 评论(3) 推荐(0) 编辑
摘要: Given an integer array , return the length of a maximum size turbulent subarray of . A subarray is turbulent if the comparison sign flips between each 阅读全文
posted @ 2020-12-24 14:07 Grandyang 阅读(945) 评论(0) 推荐(2) 编辑
摘要: Given an array of positive lengths, return the largest perimeter of a triangle with non zero area, formed from 3 of these lengths. If it is impossible 阅读全文
posted @ 2020-12-22 13:32 Grandyang 阅读(986) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I 阅读全文
posted @ 2020-12-22 13:30 Grandyang 阅读(2298) 评论(0) 推荐(1) 编辑
摘要: You are given an integer array . From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd 阅读全文
posted @ 2020-12-21 14:32 Grandyang 阅读(1304) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, return the number of (contiguous, non empty) subarrays that have a sum divisible by . Example 1: Note: 1. `1 这道题给了一个数组,让返回 阅读全文
posted @ 2020-12-20 12:43 Grandyang 阅读(1987) 评论(0) 推荐(0) 编辑
摘要: We have a list of on the plane. Find the closest points to the origin . (Here, the distance between two points on a plane is the Euclidean distance.) 阅读全文
posted @ 2020-12-19 16:00 Grandyang 阅读(3012) 评论(0) 推荐(0) 编辑
摘要: Given two strings and , each of which represents a non negative rational number, return True if and only if they represent the same number. The string 阅读全文
posted @ 2020-12-18 15:15 Grandyang 阅读(389) 评论(0) 推荐(0) 编辑
摘要: You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n val 阅读全文
posted @ 2020-12-17 15:57 Grandyang 阅读(673) 评论(0) 推荐(0) 编辑
摘要: Given two positive integers and , an integer is powerful if it is equal to for some integers and . Return a list of all powerful integers that have va 阅读全文
posted @ 2020-12-16 12:39 Grandyang 阅读(601) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers , sort the array by performing a series of pancake flips. In one pancake flip we do the following steps: Choose an integer 阅读全文
posted @ 2020-12-15 14:50 Grandyang 阅读(1098) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, we install cameras on the nodes of the tree. Each camera at a node can monitor its parent, itself, and its immediate children. Ca 阅读全文
posted @ 2020-12-14 08:54 Grandyang 阅读(1908) 评论(0) 推荐(1) 编辑
摘要: Return all non negative integers of length such that the absolute difference between every two consecutive digits is . Note that every number in the a 阅读全文
posted @ 2020-12-13 07:17 Grandyang 阅读(659) 评论(0) 推荐(0) 编辑
摘要: Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word. For a given query word, the spell checker handle 阅读全文
posted @ 2020-12-12 15:32 Grandyang 阅读(622) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right c 阅读全文
posted @ 2020-12-11 15:38 Grandyang 阅读(1837) 评论(3) 推荐(0) 编辑
摘要: A binary tree is univalued if every node in the tree has the same value. Return if and only if the given tree is univalued. Example 1: Example 2: Note 阅读全文
posted @ 2020-12-10 13:51 Grandyang 阅读(549) 评论(0) 推荐(0) 编辑
摘要: Given a single positive integer , we will write an expression of the form where each operator , , etc. is either addition, subtraction, multiplication 阅读全文
posted @ 2020-12-09 15:56 Grandyang 阅读(658) 评论(2) 推荐(0) 编辑
摘要: Given a set of points in the xy plane, determine the minimum area of any rectangle formed from these points, with sides not necessarily parallel to th 阅读全文
posted @ 2020-12-08 15:56 Grandyang 阅读(1060) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, a ramp is a tuple for which `i 这道题说给了一个数组A,这里定义了一种叫做 Ramp 的范围 (i, j),满足 `i Github 同步地址: 参考资料: "LeetCode All in One 题目讲解汇总( 阅读全文
posted @ 2020-11-29 07:55 Grandyang 阅读(977) 评论(1) 推荐(0) 编辑
摘要: In a array of size , there are unique elements, and exactly one of these elements is repeated times. Return the element repeated times. Example 1: Exa 阅读全文
posted @ 2020-11-27 03:45 Grandyang 阅读(1171) 评论(0) 推荐(1) 编辑
摘要: We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we 阅读全文
posted @ 2020-11-23 08:54 Grandyang 阅读(699) 评论(0) 推荐(0) 编辑
摘要: In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, \, or blank space. These characters divide the square into contiguous re 阅读全文
posted @ 2020-10-31 23:56 Grandyang 阅读(1189) 评论(0) 推荐(1) 编辑
摘要: Given a binary tree, determine if it is a complete binary tree. Definition of a complete binary tree from Wikipedia: In a complete binary tree every l 阅读全文
posted @ 2020-09-21 12:30 Grandyang 阅读(1820) 评论(0) 推荐(1) 编辑
摘要: There are 8 prison cells in a row, and each cell is either occupied or vacant. Each day, whether the cell is occupied or vacant changes according to t 阅读全文
posted @ 2020-08-31 04:28 Grandyang 阅读(1651) 评论(0) 推荐(0) 编辑
摘要: You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel suppor 阅读全文
posted @ 2020-08-17 13:51 Grandyang 阅读(1435) 评论(0) 推荐(0) 编辑
摘要: We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we 阅读全文
posted @ 2020-08-07 15:28 Grandyang 阅读(1089) 评论(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 @ 2020-07-26 13:25 Grandyang 阅读(1491) 评论(0) 推荐(0) 编辑
摘要: In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permu 阅读全文
posted @ 2020-07-08 15:47 Grandyang 阅读(2845) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of unique positive integers A, consider the following graph: There are A.length nodes, labelled A[0] to A[A.length - 1]; There 阅读全文
posted @ 2020-07-06 10:22 Grandyang 阅读(1718) 评论(0) 推荐(0) 编辑
摘要: For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tree X is flip e 阅读全文
posted @ 2020-07-02 15:00 Grandyang 阅读(1414) 评论(0) 推荐(0) 编辑
摘要: In a deck of cards, every card has a unique integer. You can order the deck in any order you want. Initially, all the cards start face down (unreveale 阅读全文
posted @ 2020-06-22 11:51 Grandyang 阅读(1414) 评论(0) 推荐(0) 编辑
摘要: Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hour time is 00:00, and the largest is 23:59. Starting f 阅读全文
posted @ 2020-06-14 03:29 Grandyang 阅读(1650) 评论(0) 推荐(0) 编辑
摘要: You have an initial power P, an initial score of 0 points, and a bag of tokens. Each token can be used at most once, has a value token[i], and has pot 阅读全文
posted @ 2020-06-11 13:06 Grandyang 阅读(1518) 评论(0) 推荐(1) 编辑
摘要: On a 2D plane, we place stones at some integer coordinate points. Each coordinate point may have at most one stone. Now, a move consists of removing a 阅读全文
posted @ 2020-06-01 13:29 Grandyang 阅读(2305) 评论(1) 推荐(0) 编辑
摘要: Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop o 阅读全文
posted @ 2020-05-26 03:44 Grandyang 阅读(2085) 评论(0) 推荐(1) 编辑
摘要: Given an array of integers A, a move consists of choosing any , and incrementing it by . Return the least number of moves to make every value in uniqu 阅读全文
posted @ 2020-05-18 07:56 Grandyang 阅读(1485) 评论(0) 推荐(0) 编辑
摘要: DynamoDB 是 AWS 全家桶中非常重要的一个服务,跟 MongoDB 一样,是 NoSQL 数据库。有时候我们需要将某个表的数据整个导出或者导入,如果数据量很大的话,建议使用 AWS Data Pipeline 导出和导入 DynamoDB,如果数据量不是特别大的话,建议使用 AWS CLI 阅读全文
posted @ 2020-05-13 10:18 Grandyang 阅读(1338) 评论(0) 推荐(0) 编辑
摘要: We are given an array of lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we del 阅读全文
posted @ 2020-05-11 06:16 Grandyang 阅读(1109) 评论(0) 推荐(0) 编辑
摘要: Given an array A of strings, find any smallest string that contains each string in A as a substring. We may assume that no string in A is substring of 阅读全文
posted @ 2020-05-08 14:15 Grandyang 阅读(2578) 评论(5) 推荐(0) 编辑
摘要: Given a string that only contains "I" (increase) or "D" (decrease), let . Return any permutation of such that for all : If , then Example 1: Example 2 阅读全文
posted @ 2020-04-30 04:33 Grandyang 阅读(1129) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 44 下一页
Fork me on GitHub