ÉÏÒ»Ò³ 1 ¡¤¡¤¡¤ 6 7 8 9 10 11 12 13 14 ¡¤¡¤¡¤ 44 ÏÂÒ»Ò³
ÕªÒª£º Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and add x to A[i] (only once). After this process, we ha ÔĶÁÈ«ÎÄ
posted @ 2019-08-15 23:29 Grandyang ÔĶÁ(3163) ÆÀÂÛ(2) ÍƼö(0) ±à¼­
ÕªÒª£º Strings and are similar (for some non negative integer ) if we can swap the positions of two letters in exactly times so that the resulting string equ ÔĶÁÈ«ÎÄ
posted @ 2019-08-13 02:37 Grandyang ÔĶÁ(3519) ÆÀÂÛ(2) ÍƼö(0) ±à¼­
ÕªÒª£º On an N x N , the numbers from to are written boustrophedonically starting from the bottom left of the board, and alternating direction each row. For ÔĶÁÈ«ÎÄ
posted @ 2019-08-12 21:16 Grandyang ÔĶÁ(4199) ÆÀÂÛ(4) ÍƼö(0) ±à¼­
ÕªÒª£º There are workers. The th worker has a and a minimum wage expectation . Now we want to hire exactly workers to form a paid group . When hiring a group ÔĶÁÈ«ÎÄ
posted @ 2019-08-09 20:34 Grandyang ÔĶÁ(3161) ÆÀÂÛ(0) ÍƼö(1) ±à¼­
ÕªÒª£º Given an array of integers, for each integer we may choose any with ` K ÕâµÀÌâ˵ÊǸøÁËÒ»¸ö·Ç¸ºÊýµÄÊý×飬ºÍÒ»¸ö·Ç¸ºÊýK£¬ËµÊÇÊý×éÖеÄÿһ¸öÊý×Ö¶¼¿ÉÒÔ¼ÓÉÏ [ K, K] ·¶Î§ÄÚµÄÈa56爆大奖在线娱乐âÒ»¸öÊý×Ö£¬ÎÊÐÂÊý×éµÄ×î´óÖµ×îСֵ֮¼äµÄ²îÖµ×îС ÔĶÁÈ«ÎÄ
posted @ 2019-08-07 22:20 Grandyang ÔĶÁ(2107) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º Return the length of the shortest, non-empty, contiguous subarray of A with sum at least K. If there is no non-empty subarray with sum at least K, ret ÔĶÁÈ«ÎÄ
posted @ 2019-08-04 22:01 Grandyang ÔĶÁ(6009) ÆÀÂÛ(4) ÍƼö(1) ±à¼­
ÕªÒª£º Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return ÔĶÁÈ«ÎÄ
posted @ 2019-07-30 22:53 Grandyang ÔĶÁ(6691) ÆÀÂÛ(2) ÍƼö(0) ±à¼­
ÕªÒª£º We are given a 2-dimensional grid. "." is an empty cell, "#" is a wall, "@" is the starting point, ("a", "b", ...) are keys, and ("A", "B", ...) are l ÔĶÁÈ«ÎÄ
posted @ 2019-07-20 23:27 Grandyang ÔĶÁ(2801) ÆÀÂÛ(3) ÍƼö(0) ±à¼­
ÕªÒª£º Let's say a positive integer is a *superpalindrome* if it is a palindrome, and it is also the square of a palindrome. Now, given two positive integers ÔĶÁÈ«ÎÄ
posted @ 2019-07-17 23:49 Grandyang ÔĶÁ(2125) ÆÀÂÛ(2) ÍƼö(0) ±à¼­
ÕªÒª£º A car travels from a starting position to a destination which is miles east of the starting position. Along the way, there are gas stations. Each repr ÔĶÁÈ«ÎÄ
posted @ 2019-07-14 23:58 Grandyang ÔĶÁ(3186) ÆÀÂÛ(0) ÍƼö(2) ±à¼­
ÕªÒª£º Given an array of non negative integers, return an array consisting of all the even elements of , followed by all the odd elements of . You may return ÔĶÁÈ«ÎÄ
posted @ 2019-07-11 23:32 Grandyang ÔĶÁ(4890) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º We run a preorder depth first search on the rootof a binary tree. At each node in this traversal, we output D dashes (where D is the depth of this nod ÔĶÁÈ«ÎÄ
posted @ 2019-07-08 08:22 Grandyang ÔĶÁ(1715) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º A positive integer is magical if it is divisible by either A or B. Return the N th magical number. Since the answer may be very large, return it modul ÔĶÁÈ«ÎÄ
posted @ 2019-07-07 23:49 Grandyang ÔĶÁ(2531) ÆÀÂÛ(0) ÍƼö(1) ±à¼­
ÕªÒª£º In a row of trees, the th tree produces fruit with type . You start at any tree of your choice, then repeatedly perform the following steps: 1. Add on ÔĶÁÈ«ÎÄ
posted @ 2019-07-03 23:45 Grandyang ÔĶÁ(5969) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º There are G people in a gang, and a list of various crimes they could commit. The th crime generates a and requires gang members to participate. If a ÔĶÁÈ«ÎÄ
posted @ 2019-06-29 22:52 Grandyang ÔĶÁ(2205) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º We are given , a length string of characters from the set . (These letters stand for "decreasing" and "increasing".) A valid permutation is a permutat ÔĶÁÈ«ÎÄ
posted @ 2019-06-26 23:22 Grandyang ÔĶÁ(6035) ÆÀÂÛ(3) ÍƼö(0) ±à¼­
ÕªÒª£º Starting with an undirected graph (the "original graph") with nodes from to , subdivisions are made to some of the edges. The graph is given as follow ÔĶÁÈ«ÎÄ
posted @ 2019-06-23 23:49 Grandyang ÔĶÁ(1991) ÆÀÂÛ(1) ÍƼö(0) ±à¼­
ÕªÒª£º We have a sorted set of digits D, a non-empty subset of {'1','2','3','4','5','6','7','8','9'}. (Note that '0' is not included.) Now, we write numbers ÔĶÁÈ«ÎÄ
posted @ 2019-06-20 23:53 Grandyang ÔĶÁ(2313) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º You are given eggs, and you have access to a building with floors from to . Each egg is identical in function, and if an egg breaks, you cannot drop i ÔĶÁÈ«ÎÄ
posted @ 2019-06-18 22:09 Grandyang ÔĶÁ(7490) ÆÀÂÛ(3) ÍƼö(2) ±à¼­
ÕªÒª£º Write a class which collects daily price quotes for some stock, and returns the span of that stock's price for the current day. The span of the stock' ÔĶÁÈ«ÎÄ
posted @ 2019-06-15 23:27 Grandyang ÔĶÁ(3234) ÆÀÂÛ(3) ÍƼö(0) ±à¼­
ÕªÒª£º Given an array of integers , consider all non empty subsequences of . For any sequence S, let the width of S be the difference between the maximum and ÔĶÁÈ«ÎÄ
posted @ 2019-06-13 23:02 Grandyang ÔĶÁ(1681) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º Write an iterator that iterates through a run length encoded sequence. The iterator is initialized by , where is a run length encoding of some sequenc ÔĶÁÈ«ÎÄ
posted @ 2019-06-11 22:47 Grandyang ÔĶÁ(2219) ÆÀÂÛ(0) ÍƼö(1) ±à¼­
ÕªÒª£º A string of lowercase letters is given. Then, we may make any number of moves . In each move, we choose one of the first letters (starting from the le ÔĶÁÈ«ÎÄ
posted @ 2019-06-09 23:40 Grandyang ÔĶÁ(2778) ÆÀÂÛ(0) ÍƼö(2) ±à¼­
ÕªÒª£º Implement , a class which simulates the operation of a stack like data structure. has two functions: , which pushes an integer onto the stack. , which ÔĶÁÈ«ÎÄ
posted @ 2019-06-07 22:34 Grandyang ÔĶÁ(3162) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º We have an array A of non-negative integers. For every (contiguous) subarray B = [A[i], A[i+1], ..., A[j]] (with i <= j), we take the bitwise OR of al ÔĶÁÈ«ÎÄ
posted @ 2019-06-05 23:15 Grandyang ÔĶÁ(2497) ÆÀÂÛ(6) ÍƼö(0) ±à¼­
ÕªÒª£º Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and o ÔĶÁÈ«ÎÄ
posted @ 2019-06-03 22:40 Grandyang ÔĶÁ(3315) ÆÀÂÛ(2) ÍƼö(0) ±à¼­
ÕªÒª£º An array is monotonic if it is either monotone increasing or monotone decreasing. An array is monotone increasing if for all . Return if and only if t ÔĶÁÈ«ÎÄ
posted @ 2019-06-01 23:54 Grandyang ÔĶÁ(2432) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º A full binary tree is a binary tree where each node has exactly 0 or 2 children. Return a list of all possible full binary trees with nodes. Each elem ÔĶÁÈ«ÎÄ
posted @ 2019-05-30 22:34 Grandyang ÔĶÁ(3403) ÆÀÂÛ(0) ÍƼö(1) ±à¼­
ÕªÒª£º You are given an array of strings. Two strings and are special equivalent if after any number of moves , S == T. A move consists of choosing two indic ÔĶÁÈ«ÎÄ
posted @ 2019-05-28 23:25 Grandyang ÔĶÁ(1800) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º On a grid, we place some cubes. Each value represents a tower of cubes placed on top of grid cell . Return the total surface area of the resulting sha ÔĶÁÈ«ÎÄ
posted @ 2019-05-26 23:28 Grandyang ÔĶÁ(2016) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º You have a list of and a , and you want to know which words in matches the pattern. A word matches the pattern if there exists a permutation of letter ÔĶÁÈ«ÎÄ
posted @ 2019-05-24 22:06 Grandyang ÔĶÁ(2378) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals and are distinct positive integers. Example ÔĶÁÈ«ÎÄ
posted @ 2019-05-22 23:10 Grandyang ÔĶÁ(4039) ÆÀÂÛ(2) ÍƼö(1) ±à¼­
ÕªÒª£º Alice and Bob have candy bars of different sizes: is the size of the th bar of candy that Alice has, and is the size of the th bar of candy that Bob h ÔĶÁÈ«ÎÄ
posted @ 2019-05-20 19:45 Grandyang ÔĶÁ(2218) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º On a 2 dimensional grid with rows and columns, we start at facing east. Here, the north west corner of the grid is at the first row and column, and th ÔĶÁÈ«ÎÄ
posted @ 2019-05-18 23:04 Grandyang ÔĶÁ(2633) ÆÀÂÛ(0) ÍƼö(1) ±à¼­
ÕªÒª£º We are given two sentences and . (A sentence is a string of space separated words. Each word consists only of lowercase letters.) A word is uncommon i ÔĶÁÈ«ÎÄ
posted @ 2019-05-16 20:42 Grandyang ÔĶÁ(1652) ÆÀÂÛ(0) ÍƼö(1) ±à¼­
ÕªÒª£º On a grid, we place some cubes that are axis aligned with the x, y, and z axes. Each value represents a tower of cubes placed on top of grid cell . No ÔĶÁÈ«ÎÄ
posted @ 2019-05-15 00:06 Grandyang ÔĶÁ(1849) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º The th person has weight , and each boat can carry a maximum weight of . Each boat carries at most 2 people at the same time, provided the sum of the  ÔĶÁÈ«ÎÄ
posted @ 2019-05-12 23:48 Grandyang ÔĶÁ(2739) ÆÀÂÛ(1) ÍƼö(0) ±à¼­
ÕªÒª£º An encoded string is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following steps ÔĶÁÈ«ÎÄ
posted @ 2019-05-10 23:20 Grandyang ÔĶÁ(4815) ÆÀÂÛ(1) ÍƼö(0) ±à¼­
ÕªÒª£º ÒýÑÔ ÎªÊ²Ã´Ïëµ½ÖÆ×÷Õâôһ¸ö²å¼þÄØ£¬ÊÇÒòΪ²©Ö÷ÔÚ¸üÐÂ΢ÐŹ«Öںš¾Ë¢¾¡ÌìÏ¡¿µÄºǫ́Êý¾Ý¿âʱ£¬ÐèÒªÓв©¿ÍÔ°ÌâÄ¿Ìû×ÓµÄÁ´½Ó£¬ÄÇô¾ÍÒª´ÓÕâƪÌû×Ó "LeetCode All in One ÌâÄ¿½²½â»ã×Ü(³ÖÐø¸üÐÂÖÐ...)" ÖÐÌáÈ¡¸÷¸öÌâÄ¿µÄÁ´½Ó¡£Ö®Ç°²©Ö÷¶¼ÊÇʹÓõĶ¼ÊÇExcelµÄ²å¼þ "Kutools" À´ ÔĶÁÈ«ÎÄ
posted @ 2019-05-09 10:06 Grandyang ÔĶÁ(2256) ÆÀÂÛ(0) ÍƼö(0) ±à¼­
ÕªÒª£º Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of sto ÔĶÁÈ«ÎÄ
posted @ 2019-05-07 22:44 Grandyang ÔĶÁ(7694) ÆÀÂÛ(4) ÍƼö(0) ±à¼­
ÉÏÒ»Ò³ 1 ¡¤¡¤¡¤ 6 7 8 9 10 11 12 13 14 ¡¤¡¤¡¤ 44 ÏÂÒ»Ò³
Fork me on GitHub