上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 44 下一页
摘要: Given a 2D array , each cell is 0 (representing sea) or 1 (representing land) A move consists of walking from one land square 4 directionally to anoth 阅读全文
posted @ 2021-02-07 15:19 Grandyang 阅读(641) 评论(0) 推荐(0) 编辑
摘要: We are given a linked list with as the first node. Let's number the nodes in the list: etc. Each node may have a next larger value: for , is the such 阅读全文
posted @ 2021-02-07 03:53 Grandyang 阅读(642) 评论(0) 推荐(0) 编辑
摘要: Given an array of s and s, consider : the i th subarray from to interpreted as a binary number (from most significant bit to least significant bit.) R 阅读全文
posted @ 2021-02-06 12:59 Grandyang 阅读(385) 评论(0) 推荐(0) 编辑
摘要: Given a number , return a string consisting of s and s that represents its value in base (negative two). The returned string must have no leading zero 阅读全文
posted @ 2021-02-05 14:25 Grandyang 阅读(622) 评论(1) 推荐(0) 编辑
摘要: Given a binary string (a string consisting only of '0' and '1's) and a positive integer , return true if and only if for every integer X from 1 to N, 阅读全文
posted @ 2021-02-04 14:08 Grandyang 阅读(406) 评论(1) 推荐(0) 编辑
摘要: Given a positive integer , you need to find the length of the smallest positive integer such that is divisible by , and only contains the digit . Retu 阅读全文
posted @ 2021-02-03 16:48 Grandyang 阅读(596) 评论(3) 推荐(0) 编辑
摘要: Given an array of positive integers, represents the value of the th sightseeing spot, and two sightseeing spots and have distance between them. The sc 阅读全文
posted @ 2021-02-02 13:32 Grandyang 阅读(780) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers , return if we can partition the array into three non empty parts with equal sums. Formally, we can partition the array if 阅读全文
posted @ 2021-02-01 15:37 Grandyang 阅读(522) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer , return the number of positive integers less than or equal to that have at least 1 repeated digit. Example 1: Input: 20 Outp 阅读全文
posted @ 2021-01-31 16:48 Grandyang 阅读(577) 评论(0) 推荐(0) 编辑
摘要: A conveyor belt has packages that must be shipped from one port to another within D days. The ith package on the conveyor belt has a weight of weights 阅读全文
posted @ 2021-01-30 10:18 Grandyang 阅读(1432) 评论(0) 推荐(0) 编辑
摘要: You are given a list of songs where the ith song has a duration of seconds. Return the number of pairs of songs for which their total duration in seco 阅读全文
posted @ 2021-01-29 12:55 Grandyang 阅读(938) 评论(0) 推荐(0) 编辑
摘要: Every non negative integer has a binary representation. For example, can be represented as in binary, as in binary, and so on. Note that except for , 阅读全文
posted @ 2021-01-25 06:24 Grandyang 阅读(510) 评论(0) 推荐(0) 编辑
摘要: Return the root node of a binary search tree that matches the given traversal. (Recall that a binary search tree is a binary tree where for every node 阅读全文
posted @ 2021-01-24 04:25 Grandyang 阅读(907) 评论(0) 推荐(0) 编辑
摘要: In a row of dominoes, and represent the top and bottom halves of the domino. (A domino is a tile with two numbers from 1 to 6 one on each half of the 阅读全文
posted @ 2021-01-20 15:20 Grandyang 阅读(633) 评论(0) 推荐(0) 编辑
摘要: Normally, the factorial of a positive integer is the product of all positive integers less than or equal to . For example, . We instead make a clumsy 阅读全文
posted @ 2021-01-19 10:08 Grandyang 阅读(436) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, we must modify the array in the following way: we choose an and replace with , and we repeat this process times in total. 阅读全文
posted @ 2021-01-18 08:31 Grandyang 阅读(979) 评论(0) 推荐(0) 编辑
摘要: Given an array of 0s and 1s, we may change up to values from 0 to 1. Return the length of the longest (contiguous) subarray that contains only 1s. Exa 阅读全文
posted @ 2021-01-18 06:08 Grandyang 阅读(2071) 评论(0) 推荐(1) 编辑
摘要: Given a string , determine if it is valid. A string is valid if, starting with an empty string , you can transform into after performing the following 阅读全文
posted @ 2021-01-17 07:30 Grandyang 阅读(383) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (including dup 阅读全文
posted @ 2021-01-16 13:47 Grandyang 阅读(1270) 评论(0) 推荐(0) 编辑
摘要: You are given a grid of size N x N, and each cell of this grid has a lamp that is initially turned off. You are also given an array of lamp positions  阅读全文
posted @ 2021-01-15 15:39 Grandyang 阅读(570) 评论(2) 推荐(0) 编辑
摘要: On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. These are given as characters 'R', ' 阅读全文
posted @ 2021-01-14 14:54 Grandyang 阅读(616) 评论(0) 推荐(0) 编辑
摘要: We are given the node of a maximum tree: a tree where every node has a value greater than any other value in its subtree. Just as in the "previous pro 阅读全文
posted @ 2021-01-13 13:32 Grandyang 阅读(603) 评论(0) 推荐(0) 编辑
摘要: In a town, there are people labelled from to . There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: 1 阅读全文
posted @ 2021-01-12 12:47 Grandyang 阅读(1245) 评论(0) 推荐(0) 编辑
摘要: Given an array of non negative integers, the array is squareful if for every pair of adjacent elements, their sum is a perfect square. Return the numb 阅读全文
posted @ 2021-01-11 11:16 Grandyang 阅读(747) 评论(0) 推荐(0) 编辑
摘要: You are given an `grid` where each cell can have one of three values: representing an empty cell, representing a fresh orange, or representing a rotte 阅读全文
posted @ 2021-01-10 04:07 Grandyang 阅读(1988) 评论(0) 推荐(1) 编辑
摘要: In a binary tree, the root node is at depth , and children of each depth node are at depth . Two nodes of a binary tree are cousins if they have the s 阅读全文
posted @ 2021-01-09 15:46 Grandyang 阅读(1159) 评论(0) 推荐(0) 编辑
摘要: Given an array of positive integers, call a (contiguous, not necessarily distinct) subarray of good if the number of different integers in that subarr 阅读全文
posted @ 2021-01-08 16:00 Grandyang 阅读(2281) 评论(1) 推荐(0) 编辑
摘要: On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; D 阅读全文
posted @ 2021-01-05 14:17 Grandyang 阅读(951) 评论(0) 推荐(0) 编辑
摘要: Given two strings and , return the length of their longest common subsequence. A subsequence of a string is a new string generated from the original s 阅读全文
posted @ 2021-01-04 16:36 Grandyang 阅读(3791) 评论(2) 推荐(0) 编辑
摘要: Given an array equations of strings that represent relationships between variables, each string has length and takes one of two different forms: or . 阅读全文
posted @ 2021-01-03 13:51 Grandyang 阅读(968) 评论(0) 推荐(0) 编辑
摘要: For a non negative integer , the array form of is an array of its digits in left to right order. For example, if , then the array form is . Given the 阅读全文
posted @ 2021-01-02 05:46 Grandyang 阅读(978) 评论(0) 推荐(0) 编辑
摘要: Given the of a binary tree, each node has a value from to representing the letters to : a value of represents , a value of represents , and so on. Fin 阅读全文
posted @ 2021-01-01 14:31 Grandyang 阅读(689) 评论(0) 推荐(0) 编辑
摘要: Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval li 阅读全文
posted @ 2021-01-01 13:36 Grandyang 阅读(1542) 评论(0) 推荐(0) 编辑
摘要: We have an array of integers, and an array of queries. For the th query , we add val to . Then, the answer to the th query is the sum of the even valu 阅读全文
posted @ 2020-12-31 14:23 Grandyang 阅读(516) 评论(0) 推荐(0) 编辑
摘要: Given two integers and , return any string such that: has length and contains exactly `'a' b` letters, The substring does not occur in , and The subst 阅读全文
posted @ 2020-12-30 13:15 Grandyang 阅读(602) 评论(0) 推荐(0) 编辑
摘要: In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given 阅读全文
posted @ 2020-12-29 12:21 Grandyang 阅读(1761) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers , find the number of triples of indices (i, j, k) such that: `0 这道题给了一个数组,定义了a56爆大奖在线娱乐三元组,使得这三个数字相‘与’得到为0,问有多少种不同的组合。根据题目中的例子可以发现, 阅读全文
posted @ 2020-12-28 11:07 Grandyang 阅读(482) 评论(0) 推荐(0) 编辑
摘要: Create a timebased key value store class , that supports two operations. 1\. Stores the and , along with the given . 2\. Returns a value such that was 阅读全文
posted @ 2020-12-27 04:01 Grandyang 阅读(2096) 评论(0) 推荐(0) 编辑
摘要: On a 2 dimensional , there are 4 types of squares: represents the starting square. There is exactly one starting square. represents the ending square. 阅读全文
posted @ 2020-12-26 09:42 Grandyang 阅读(1679) 评论(2) 推荐(0) 编辑
摘要: 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 阅读(1791) 评论(3) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 44 下一页
Fork me on GitHub