10 2018 档案

摘要:Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warme 阅读全文
posted @ 2018-10-31 09:29 轻风舞动 阅读(1478) 评论(0) 推荐(0) 编辑
摘要:Given an integer, return its base 7 string representation. Example 1: Example 2: Note: The input will be in range of [-1e7, 1e7]. 给一个整数,返回它的七进制数。 解法1: 阅读全文
posted @ 2018-10-27 09:29 轻风舞动 阅读(509) 评论(0) 推荐(0) 编辑
摘要:We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write 阅读全文
posted @ 2018-10-27 09:08 轻风舞动 阅读(821) 评论(0) 推荐(0) 编辑
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2018-10-27 08:39 轻风舞动 阅读(264) 评论(0) 推荐(0) 编辑
摘要:Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects 阅读全文
posted @ 2018-10-27 06:41 轻风舞动 阅读(762) 评论(0) 推荐(0) 编辑
摘要:In LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascend 阅读全文
posted @ 2018-10-27 06:29 轻风舞动 阅读(538) 评论(0) 推荐(0) 编辑
摘要:Print a binary tree in an m*n 2D string array following these rules: Example 1: Example 2: Example 3: Note: The height of binary tree is in the range 阅读全文
posted @ 2018-10-27 04:47 轻风舞动 阅读(656) 评论(0) 推荐(0) 编辑
摘要:Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given array a 阅读全文
posted @ 2018-10-26 09:34 轻风舞动 阅读(416) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 给一个非空二叉树,返回每层的平均值组成的数组。 解 阅读全文
posted @ 2018-10-26 08:35 轻风舞动 阅读(535) 评论(0) 推荐(0) 编辑
摘要:Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find the exclusive time of these functions. Each funct 阅读全文
posted @ 2018-10-26 07:44 轻风舞动 阅读(585) 评论(0) 推荐(0) 编辑
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it 阅读全文
posted @ 2018-10-26 04:47 轻风舞动 阅读(1939) 评论(0) 推荐(0) 编辑
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2018-10-26 04:34 轻风舞动 阅读(2599) 评论(0) 推荐(0) 编辑
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2018-10-26 04:26 轻风舞动 阅读(3016) 评论(0) 推荐(0) 编辑
摘要:Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer nand is grea 阅读全文
posted @ 2018-10-26 03:41 轻风舞动 阅读(442) 评论(0) 推荐(0) 编辑
摘要:Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The 阅读全文
posted @ 2018-10-25 09:44 轻风舞动 阅读(542) 评论(0) 推荐(0) 编辑
摘要:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2018-10-25 09:04 轻风舞动 阅读(548) 评论(0) 推荐(0) 编辑
摘要:You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rota 阅读全文
posted @ 2018-10-25 08:10 轻风舞动 阅读(654) 评论(0) 推荐(0) 编辑
摘要:You can keep inputting the password, the password will automatically be matched against the last n digits entered. For example, assuming the password 阅读全文
posted @ 2018-10-25 07:28 轻风舞动 阅读(854) 评论(0) 推荐(0) 编辑
摘要:International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a"maps to ".-", "b" maps 阅读全文
posted @ 2018-10-25 05:32 轻风舞动 阅读(540) 评论(0) 推荐(0) 编辑
摘要:In a given integer array A, we must move every element of A to either list B or list C. (B and C initially start empty.) Return true if and only if af 阅读全文
posted @ 2018-10-25 05:09 轻风舞动 阅读(970) 评论(0) 推荐(0) 编辑
摘要:In a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it h 阅读全文
posted @ 2018-10-25 02:23 轻风舞动 阅读(499) 评论(0) 推荐(0) 编辑
摘要:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of ston 阅读全文
posted @ 2018-10-23 09:41 轻风舞动 阅读(576) 评论(0) 推荐(0) 编辑
摘要:On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0. A move consists of choosing 0 and a 4 阅读全文
posted @ 2018-10-23 09:27 轻风舞动 阅读(947) 评论(0) 推荐(0) 编辑
摘要:Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th 阅读全文
posted @ 2018-10-23 09:00 轻风舞动 阅读(373) 评论(0) 推荐(0) 编辑
摘要:In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least 阅读全文
posted @ 2018-10-21 13:49 轻风舞动 阅读(846) 评论(0) 推荐(0) 编辑
摘要:Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S = 阅读全文
posted @ 2018-10-21 10:05 轻风舞动 阅读(803) 评论(0) 推荐(0) 编辑
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 给一个整数数组,找出乘积最大的3个数,返回这 阅读全文
posted @ 2018-10-20 02:32 轻风舞动 阅读(389) 评论(0) 推荐(0) 编辑
摘要:有 n 个硬币排成一条线。两个参赛者轮流从右边依次拿走 1 或 2 个硬币,直到没有硬币为止。拿到最后一枚硬币的人获胜。 请判定 第一个玩家 是输还是赢? n = 1, 返回 true.n = 2, 返回 true.n = 3, 返回 false.n = 4, 返回 true.n = 5, 返回 t 阅读全文
posted @ 2018-10-19 09:31 轻风舞动 阅读(171) 评论(0) 推荐(0) 编辑
摘要:有 n 个不同价值的硬币排成一条线。两个参赛者轮流从左边依次拿走 1 或 2 个硬币,直到没有硬币为止。计算两个人分别拿到的硬币总价值,价值高的人获胜。 请判定 第一个玩家 是输还是赢? 样例给定数组 A = [1,2,2], 返回 true.给定数组 A = [1,2,4], 返回 false. 阅读全文
posted @ 2018-10-19 09:28 轻风舞动 阅读(396) 评论(0) 推荐(0) 编辑
摘要:2D平面上,有m个人(P),n辆自行车(B),还有空白(O)满足以下条件1.m < n. 2.不存在两个人,到同一辆自行车距离相等, 距离用abs(x1-x2) + abs(y1-y2)定义3.每个人尽量找离自己最近的自行车,一旦某辆自行车被占,其他人只能找别的自行车。例OPOBOOPOOOOOOO 阅读全文
posted @ 2018-10-18 09:34 轻风舞动 阅读(4231) 评论(0) 推荐(0) 编辑
摘要:Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2018-10-18 09:31 轻风舞动 阅读(378) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumR 阅读全文
posted @ 2018-10-18 09:13 轻风舞动 阅读(397) 评论(0) 推荐(0) 编辑
摘要:You are given a campus map with the Google buildings, roads and Google bikes. You have to help the employee find the nearest Google bike. Campus map: 阅读全文
posted @ 2018-10-18 08:08 轻风舞动 阅读(809) 评论(0) 推荐(0) 编辑
摘要:What are the differences between a process and a thread? How are they similar? How can 2 threads communicate? How can 2 process communicate? Both proc 阅读全文
posted @ 2018-10-18 07:36 轻风舞动 阅读(447) 评论(0) 推荐(0) 编辑
摘要:Given a family tree for a few generations for the entire population and two people write a routine that will find out if they are blood related. Sibli 阅读全文
posted @ 2018-10-18 05:15 轻风舞动 阅读(899) 评论(0) 推荐(0) 编辑
摘要:Implement a magic directory with buildDict, and search methods. For the method buildDict, you'll be given a list of non-repetitive words to build a di 阅读全文
posted @ 2018-10-18 04:36 轻风舞动 阅读(626) 评论(0) 推荐(0) 编辑
摘要:You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq 阅读全文
posted @ 2018-10-18 02:23 轻风舞动 阅读(574) 评论(0) 推荐(0) 编辑
摘要:We have a list of bus routes. Each routes[i] is a bus route that the i-th bus repeats forever. For example if routes[0] = [1, 5, 7], this means that t 阅读全文
posted @ 2018-10-17 09:24 轻风舞动 阅读(905) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic 阅读全文
posted @ 2018-10-17 07:56 轻风舞动 阅读(564) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any 阅读全文
posted @ 2018-10-17 07:41 轻风舞动 阅读(434) 评论(0) 推荐(0) 编辑
摘要:Given a list of strings, you could concatenate these strings together into a loop, where for each string you could choose to reverse it or not. Among 阅读全文
posted @ 2018-10-17 06:38 轻风舞动 阅读(1022) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree. Especially, this path can be either increasing or decreas 阅读全文
posted @ 2018-10-17 06:05 轻风舞动 阅读(847) 评论(0) 推荐(0) 编辑
摘要:Given a k-ary tree, find the length of the longest consecutive sequence path. The path could be start and end at any node in the treeExampleAn example 阅读全文
posted @ 2018-10-17 06:04 轻风舞动 阅读(312) 评论(0) 推荐(0) 编辑
摘要:Given a grid where each entry is only 0 or 1, find the number of corner rectangles. A corner rectangle is 4 distinct 1s on the grid that form an axis- 阅读全文
posted @ 2018-10-16 09:41 轻风舞动 阅读(711) 评论(0) 推荐(0) 编辑
摘要:There are N workers. The i-th worker has a quality[i] and a minimum wage expectation wage[i]. Now we want to hire exactly K workers to form a paid gro 阅读全文
posted @ 2018-10-16 08:44 轻风舞动 阅读(2443) 评论(0) 推荐(0) 编辑
摘要:N cars are going to the same destination along a one lane road. The destination is target miles away. Each car i has a constant speed speed[i] (in mil 阅读全文
posted @ 2018-10-16 07:26 轻风舞动 阅读(1148) 评论(0) 推荐(0) 编辑
摘要:In an exam room, there are N seats in a single row, numbered 0, 1, 2, ..., N-1. When a student enters the room, they must sit in the seat that maximiz 阅读全文
posted @ 2018-10-16 06:45 轻风舞动 阅读(1805) 评论(0) 推荐(0) 编辑
摘要:You have a list of words and a pattern, and you want to know which words in words matches the pattern. A word matches the pattern if there exists a pe 阅读全文
posted @ 2018-10-16 06:12 轻风舞动 阅读(676) 评论(0) 推荐(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 @ 2018-10-16 05:59 轻风舞动 阅读(2902) 评论(0) 推荐(0) 编辑
摘要:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1and s2. Example 1: Example 2: 给定字符串s1, s2, s3,求s3是否可以由s1和s2交错形成。 解法:DP动态规划, 递推公式为 阅读全文
posted @ 2018-10-16 05:22 轻风舞动 阅读(476) 评论(0) 推荐(0) 编辑
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文
posted @ 2018-10-16 05:09 轻风舞动 阅读(367) 评论(0) 推荐(0) 编辑
摘要:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
posted @ 2018-10-16 04:45 轻风舞动 阅读(394) 评论(0) 推荐(0) 编辑
摘要:Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Example 2: Follow up: A 阅读全文
posted @ 2018-10-16 04:36 轻风舞动 阅读(477) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example:Given 阅读全文
posted @ 2018-10-16 04:27 轻风舞动 阅读(1259) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo 阅读全文
posted @ 2018-10-16 04:09 轻风舞动 阅读(666) 评论(0) 推荐(1) 编辑
摘要:Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
posted @ 2018-10-16 02:17 轻风舞动 阅读(440) 评论(0) 推荐(0) 编辑
摘要:In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this n 阅读全文
posted @ 2018-10-16 01:37 轻风舞动 阅读(550) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 阅读全文
posted @ 2018-10-13 05:31 轻风舞动 阅读(772) 评论(0) 推荐(0) 编辑
摘要:Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2018-10-13 05:13 轻风舞动 阅读(506) 评论(0) 推荐(0) 编辑
摘要:Given a text file file.txt, print just the 10th line of the file. Example: Assume that file.txt has the following content: Your script should output t 阅读全文
posted @ 2018-10-12 02:20 轻风舞动 阅读(556) 评论(0) 推荐(0) 编辑
摘要:Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d vectors: By calling next repeatedly until  阅读全文
posted @ 2018-10-11 14:49 轻风舞动 阅读(677) 评论(0) 推荐(0) 编辑
摘要:Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example 1: Example 2: Note:You may assume all input has v 阅读全文
posted @ 2018-10-11 13:42 轻风舞动 阅读(2371) 评论(0) 推荐(0) 编辑
摘要:Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
posted @ 2018-10-11 13:41 轻风舞动 阅读(715) 评论(0) 推荐(0) 编辑
摘要:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
posted @ 2018-10-11 08:45 轻风舞动 阅读(402) 评论(0) 推荐(0) 编辑
摘要:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to 阅读全文
posted @ 2018-10-11 07:59 轻风舞动 阅读(748) 评论(0) 推荐(0) 编辑
摘要:Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutati 阅读全文
posted @ 2018-10-10 09:04 轻风舞动 阅读(1079) 评论(0) 推荐(0) 编辑
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
posted @ 2018-10-10 08:36 轻风舞动 阅读(535) 评论(0) 推荐(0) 编辑
摘要:Design a Phone Directory which supports the following operations: Example: 设计一个电话目录有3个功能,get: 给出一个没有使用的电话号码,check: 查验一个电话号码是否被使用了,release: 释放一个电话号码,使其 阅读全文
posted @ 2018-10-10 05:06 轻风舞动 阅读(820) 评论(0) 推荐(0) 编辑
摘要:On a horizontal number line, we have gas stations at positions stations[0], stations[1], ..., stations[N-1], where N = stations.length. Now, we add K  阅读全文
posted @ 2018-10-10 01:43 轻风舞动 阅读(1182) 评论(0) 推荐(0) 编辑
摘要:Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Example 1: Given 阅读全文
posted @ 2018-10-09 14:21 轻风舞动 阅读(1614) 评论(0) 推荐(0) 编辑
摘要:In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we would like to implement the following query function: TopVotedCandidat 阅读全文
posted @ 2018-10-09 04:47 轻风舞动 阅读(1351) 评论(0) 推荐(0) 编辑
摘要:Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2018-10-09 02:40 轻风舞动 阅读(874) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes  阅读全文
posted @ 2018-10-09 02:24 轻风舞动 阅读(1338) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Note: 新题中没有提示,老版的有。 阅读全文
posted @ 2018-10-09 02:13 轻风舞动 阅读(449) 评论(0) 推荐(0) 编辑
摘要:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example 阅读全文
posted @ 2018-10-09 02:02 轻风舞动 阅读(399) 评论(0) 推荐(0) 编辑
摘要:In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N nodes (wi 阅读全文
posted @ 2018-10-07 15:57 轻风舞动 阅读(637) 评论(0) 推荐(0) 编辑
摘要:Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given 阅读全文
posted @ 2018-10-07 14:48 轻风舞动 阅读(1152) 评论(0) 推荐(0) 编辑
摘要:You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups b 阅读全文
posted @ 2018-10-06 15:07 轻风舞动 阅读(365) 评论(0) 推荐(0) 编辑
摘要:Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the vali 阅读全文
posted @ 2018-10-06 07:34 轻风舞动 阅读(650) 评论(0) 推荐(0) 编辑
摘要:This question is about implementing a basic elimination algorithm for Candy Crush. Given a 2D integer array board representing the grid of candy, diff 阅读全文
posted @ 2018-10-05 09:24 轻风舞动 阅读(1553) 评论(0) 推荐(0) 编辑
摘要:Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it. https://www.geeksfor 阅读全文
posted @ 2018-10-05 05:08 轻风舞动 阅读(506) 评论(0) 推荐(0) 编辑
摘要:https://www.careercup.com/question?id=5103530547347456 Given a list of nodes, each with a left child and a right child (they can be null), determine i 阅读全文
posted @ 2018-10-05 05:05 轻风舞动 阅读(298) 评论(0) 推荐(0) 编辑
摘要:Considering that I'ld would like to spread a promotion message across all people in twitter. Assuming the ideal case, if a person tweets a message, th 阅读全文
posted @ 2018-10-04 08:23 轻风舞动 阅读(279) 评论(0) 推荐(0) 编辑
摘要:Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2018-10-04 04:51 轻风舞动 阅读(613) 评论(0) 推荐(0) 编辑
摘要:Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. Follow up:Wha 阅读全文
posted @ 2018-10-03 09:39 轻风舞动 阅读(529) 评论(0) 推荐(0) 编辑
摘要:Shuffle a set of numbers without duplicates. Example: 给一个没有重复数字的数组,实现重置和洗牌的功能。 解法:遍历数组每个位置,每次都随机生成一个坐标位置,然后交换当前位置和随机位置的数字,这样如果数组有n个数字,那么也随机交换了n组位置,从而达 阅读全文
posted @ 2018-10-03 09:28 轻风舞动 阅读(741) 评论(0) 推荐(0) 编辑
摘要:Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or blocked. The robot cleaner with 4 given APIs can move forward 阅读全文
posted @ 2018-10-03 09:17 轻风舞动 阅读(5050) 评论(0) 推荐(0) 编辑
摘要:A group of friends went on holiday and sometimes lent each other money. For example, Alice paid for Bill's lunch for 10.ThenlaterChrisgaveAlice10.Then 阅读全文
posted @ 2018-10-03 08:41 轻风舞动 阅读(1920) 评论(0) 推荐(0) 编辑
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-10-03 07:05 轻风舞动 阅读(239) 评论(0) 推荐(0) 编辑
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-10-03 02:23 轻风舞动 阅读(343) 评论(0) 推荐(0) 编辑
摘要:Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example,MovingAverage m = new Mo 阅读全文
posted @ 2018-10-02 13:09 轻风舞动 阅读(1308) 评论(0) 推荐(0) 编辑
摘要:In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o 阅读全文
posted @ 2018-10-02 09:32 轻风舞动 阅读(1144) 评论(0) 推荐(0) 编辑
摘要:Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree. You may assume each number in the seq 阅读全文
posted @ 2018-10-02 09:16 轻风舞动 阅读(618) 评论(0) 推荐(0) 编辑
摘要:This is a follow up of Shortest Word Distance. The only difference is now you are given the list of words and your method will be called repeatedly ma 阅读全文
posted @ 2018-10-02 08:24 轻风舞动 阅读(1046) 评论(0) 推荐(0) 编辑
摘要:This is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as word2. Given a list of words and two words word1 阅读全文
posted @ 2018-10-02 08:23 轻风舞动 阅读(612) 评论(0) 推荐(0) 编辑
摘要:Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example,Assume that words = 阅读全文
posted @ 2018-10-02 08:21 轻风舞动 阅读(794) 评论(0) 推荐(0) 编辑
摘要:Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
posted @ 2018-10-02 08:03 轻风舞动 阅读(505) 评论(0) 推荐(0) 编辑
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2018-10-02 05:15 轻风舞动 阅读(1212) 评论(0) 推荐(0) 编辑
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2018-10-02 04:31 轻风舞动 阅读(589) 评论(0) 推荐(0) 编辑
摘要:Given an integer n, return the number of trailing zeroes in n!. Example 1: Example 2: Note: Your solution should be in logarithmic time complexity. 给一 阅读全文
posted @ 2018-10-02 03:17 轻风舞动 阅读(309) 评论(0) 推荐(0) 编辑
摘要:In the following, every capital letter represents some hexadecimal digit from 0 to f. The red-green-blue color "#AABBCC" can be written as "#ABC" in s 阅读全文
posted @ 2018-10-01 05:54 轻风舞动 阅读(872) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示