摘要: Description Given a board which is a 2D matrix includes a-z and dictionary dict, find the largest collection of words on the board, the words can not 阅读全文
posted @ 2019-12-21 23:10 YuriFLAG 阅读(387) 评论(0) 推荐(0)
摘要: Description Given a set of words without duplicates, find all word squares you can build from them. A sequence of words forms a valid word square if t 阅读全文
posted @ 2019-12-21 23:06 YuriFLAG 阅读(337) 评论(0) 推荐(0)
摘要: Description Find connected component in undirected graph. Each node in the graph contains a label and a list of its neighbors. (A connected component 阅读全文
posted @ 2019-12-21 23:04 YuriFLAG 阅读(334) 评论(0) 推荐(0)
摘要: Description Find the number Weak Connected Component in the directed graph. Each node in the graph contains a label and a list of its neighbors. (a we 阅读全文
posted @ 2019-12-21 23:02 YuriFLAG 阅读(321) 评论(0) 推荐(0)
摘要: Description Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. Description Given a 2D board containing 'X' and 'O', captu 阅读全文
posted @ 2019-12-21 23:00 YuriFLAG 阅读(191) 评论(0) 推荐(0)
摘要: Description Build tries from a list of <word, freq> pairs. Save top 10 for each node. Example Example1 Input: <"abc", 2> <"ac", 4> <"ab", 9> Output:<a 阅读全文
posted @ 2019-12-21 22:57 YuriFLAG 阅读(233) 评论(0) 推荐(0)
摘要: Description Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or 阅读全文
posted @ 2019-12-21 22:54 YuriFLAG 阅读(190) 评论(0) 推荐(0)
摘要: Description Implement an iterator to flatten a 2d vector. Example Example 1: Input:[[1,2],[3],[4,5,6]] Output:[1,2,3,4,5,6] Example 2: Input:[[7,9],[5 阅读全文
posted @ 2019-12-21 22:52 YuriFLAG 阅读(301) 评论(0) 推荐(0)
摘要: Description Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill usin 阅读全文
posted @ 2019-12-21 22:51 YuriFLAG 阅读(180) 评论(0) 推荐(0)
摘要: Description Follow up Zigzag Iterator: What if you are given k 1d vectors? How well can your code be extended to such cases? The "Zigzag" order is not 阅读全文
posted @ 2019-12-21 22:49 YuriFLAG 阅读(226) 评论(0) 推荐(0)
摘要: Description Given two 1d vectors, implement an iterator to return their elements alternately. Example Example1 Input: v1 = [1, 2] and v2 = [3, 4, 5, 6 阅读全文
posted @ 2019-12-21 22:47 YuriFLAG 阅读(132) 评论(0) 推荐(0)
摘要: Description Given a 2D grid, each cell is either an house 1 or empty 0 (the number zero, one), find the place to build a post office, the distance tha 阅读全文
posted @ 2019-12-21 22:45 YuriFLAG 阅读(330) 评论(0) 推荐(0)
摘要: Description Given a 2D grid, each cell is either a wall 2, an house 1 or empty 0 (the number zero, one, two), find a place to build a post office so t 阅读全文
posted @ 2019-12-21 22:42 YuriFLAG 阅读(269) 评论(0) 推荐(0)
摘要: Description Design an iterator over a binary search tree with the following rules: Description Design an iterator over a binary search tree with the f 阅读全文
posted @ 2019-12-21 22:40 YuriFLAG 阅读(153) 评论(0) 推荐(0)
摘要: Description Given an array of n * m matrix, and a moving matrix window (size k * k), move the window from top left to bottom right at each iteration, 阅读全文
posted @ 2019-12-21 22:36 YuriFLAG 阅读(234) 评论(0) 推荐(0)
摘要: Description Given an integer array, find a subarray with sum closest to zero. Return the indexes of the first number and last number. Description Give 阅读全文
posted @ 2019-12-21 22:35 YuriFLAG 阅读(140) 评论(0) 推荐(0)
摘要: Description Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't 阅读全文
posted @ 2019-12-21 22:33 YuriFLAG 阅读(271) 评论(0) 推荐(0)
摘要: Description Description Find the kth smallest number in a row and column sorted matrix. Each row and each column of the matrix is incremental. Example 阅读全文
posted @ 2019-12-21 22:32 YuriFLAG 阅读(199) 评论(0) 推荐(0)
摘要: Description Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Description Given an unsorted arr 阅读全文
posted @ 2019-12-21 22:28 YuriFLAG 阅读(257) 评论(0) 推荐(0)
摘要: Description Given an positive integer array A and an interval. Return the number of subarrays whose sum is in the range of given interval. Description 阅读全文
posted @ 2019-12-21 22:27 YuriFLAG 阅读(145) 评论(0) 推荐(0)
摘要: Description Given an circular integer array (the next element of the last element is the first element), find a continuous subarray in it, where the s 阅读全文
posted @ 2019-12-21 22:25 YuriFLAG 阅读(183) 评论(0) 推荐(0)
摘要: Description Description Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index 阅读全文
posted @ 2019-12-21 22:24 YuriFLAG 阅读(156) 评论(0) 推荐(0)
摘要: Description Description Given an integer matrix, find a submatrix where the sum of numbers is zero. Your code should return the coordinate of the left 阅读全文
posted @ 2019-12-21 22:23 YuriFLAG 阅读(228) 评论(0) 推荐(0)
摘要: Description Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Description Gi 阅读全文
posted @ 2019-12-21 22:22 YuriFLAG 阅读(281) 评论(0) 推荐(0)
摘要: Description Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may a 阅读全文
posted @ 2019-12-21 22:20 YuriFLAG 阅读(125) 评论(0) 推荐(0)
摘要: Description Description Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first numbe 阅读全文
posted @ 2019-12-21 22:18 YuriFLAG 阅读(223) 评论(0) 推荐(0)
摘要: Description Given a list, each element in the list can be a list or integer. flatten it into a simply list with integers. Description Description Give 阅读全文
posted @ 2019-12-21 22:16 YuriFLAG 阅读(309) 评论(0) 推荐(0)
摘要: Description Flatten a binary tree to a fake "linked list" in pre-order traversal. Here we use the right pointer in TreeNode as the next pointer in Lis 阅读全文
posted @ 2019-12-21 22:15 YuriFLAG 阅读(238) 评论(0) 推荐(0)
摘要: Description Given three strings: s1, s2, s3, determine whether s3 is formed by the interleaving of s1 and s2. Description Description Given three stri 阅读全文
posted @ 2019-12-21 22:12 YuriFLAG 阅读(190) 评论(0) 推荐(0)
摘要: Description Given an integer array, adjust each integers so that the difference of every adjacent integers are not greater than a given number target. 阅读全文
posted @ 2019-12-21 22:10 YuriFLAG 阅读(120) 评论(0) 推荐(0)
摘要: Description Description Given two strings S and T. Count the number of distinct subsequences of S which equals T. A subsequence of a string is a new s 阅读全文
posted @ 2019-12-21 22:09 YuriFLAG 阅读(254) 评论(0) 推荐(0)
摘要: Description Given n kinds of items, and each kind of item has an infinite number available. The i-th item has size A[i] and value V[i]. Also given a b 阅读全文
posted @ 2019-12-21 22:06 YuriFLAG 阅读(201) 评论(0) 推荐(0)
摘要: Description Description Given an integer array nums[] which contains n unique positive numbers, num[i] indicate the size of ith item. An integer targe 阅读全文
posted @ 2019-12-21 22:04 YuriFLAG 阅读(279) 评论(0) 推荐(0)
摘要: Description Description Given n items with size nums[i] which an integer array and all positive numbers. An integer target denotes the size of a backp 阅读全文
posted @ 2019-12-21 22:02 YuriFLAG 阅读(209) 评论(0) 推荐(0)
摘要: Description Given an integer array nums with all positive numbers and no duplicates, find the number of possible combinations that add up to a positiv 阅读全文
posted @ 2019-12-21 21:56 YuriFLAG 阅读(202) 评论(0) 推荐(0)
摘要: Description Description Given n distinct positive integers, integer k (k <= n) and a number target. Find k numbers where sum is target. Calculate how 阅读全文
posted @ 2019-12-21 21:54 YuriFLAG 阅读(311) 评论(0) 推荐(0)
摘要: Description Description Given a set of strings which just has lower case letters and a target string, output all the strings for each the edit distanc 阅读全文
posted @ 2019-12-21 21:50 YuriFLAG 阅读(225) 评论(0) 推荐(0)
摘要: Description Description Given two strings, find the longest common subsequence (LCS). Your code should return the length of LCS. Clarification What's 阅读全文
posted @ 2019-12-21 21:47 YuriFLAG 阅读(299) 评论(0) 推荐(0)
摘要: Description Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill this backpack? Description Description Give 阅读全文
posted @ 2019-12-21 21:46 YuriFLAG 阅读(243) 评论(0) 推荐(0)
摘要: Description Description Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is count 阅读全文
posted @ 2019-12-21 21:44 YuriFLAG 阅读(210) 评论(0) 推荐(0)
摘要: Description There are n items and a backpack with size m. Given array A representing the size of each item and array V representing the value of each 阅读全文
posted @ 2019-12-21 21:43 YuriFLAG 阅读(283) 评论(0) 推荐(0)
摘要: Description Description There is a stone game.At the beginning of the game the player picks n piles of stones in a line. The goal is to merge the ston 阅读全文
posted @ 2019-12-21 21:40 YuriFLAG 阅读(304) 评论(0) 推荐(0)
摘要: Description Description There is a stone game.At the beginning of the game the player picks n piles of stones in a circle. The goal is to merge the st 阅读全文
posted @ 2019-12-21 21:39 YuriFLAG 阅读(272) 评论(0) 推荐(0)
摘要: Description Description There are n coins in a line, and value of i-th coin is values[i]. Two players take turns to take a coin from one of the ends o 阅读全文
posted @ 2019-12-21 21:37 YuriFLAG 阅读(167) 评论(0) 推荐(0)
摘要: Description Description There are n houses on a line. Given an array A and A[i] represents the position of i-th house. Now you need to pick k position 阅读全文
posted @ 2019-12-21 21:32 YuriFLAG 阅读(363) 评论(0) 推荐(0)
摘要: Description Given an array prices and the i-th element of it represents the price of a stock on the i-th day. You may complete at most k transactions. 阅读全文
posted @ 2019-12-21 21:30 YuriFLAG 阅读(263) 评论(0) 推荐(0)
摘要: Description Description Given a string, find length of the longest repeating subsequence such that the two subsequence don’t have same string characte 阅读全文
posted @ 2019-12-21 21:28 YuriFLAG 阅读(193) 评论(0) 推荐(0)
摘要: Description Description Given a 2D binary matrix filled with 0's and 1's, find the largest square which diagonal is all 1 and others is 0. Only consid 阅读全文
posted @ 2019-12-21 21:27 YuriFLAG 阅读(195) 评论(0) 推荐(0)
摘要: Description Description Given an integer matrix. Find the longest increasing continuous subsequence in this matrix and return the length of it. The lo 阅读全文
posted @ 2019-12-21 21:26 YuriFLAG 阅读(213) 评论(0) 推荐(0)
摘要: Description 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 阅读全文
posted @ 2019-12-21 21:24 YuriFLAG 阅读(169) 评论(0) 推荐(0)
摘要: Description Description Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked 阅读全文
posted @ 2019-12-21 21:21 YuriFLAG 阅读(162) 评论(0) 推荐(0)
摘要: Description A message containing letters from A-Z is being encoded to numbers using the following mapping way: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Beyond 阅读全文
posted @ 2019-12-21 21:18 YuriFLAG 阅读(215) 评论(0) 推荐(0)
摘要: Description Description Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Cla 阅读全文
posted @ 2019-12-21 21:16 YuriFLAG 阅读(241) 评论(0) 推荐(0)
摘要: Description Find the contiguous subarray within an array (containing at least one number) which has the largest product. Description Description Find 阅读全文
posted @ 2019-12-21 21:13 YuriFLAG 阅读(222) 评论(0) 推荐(0)
摘要: Description Description You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the onl 阅读全文
posted @ 2019-12-21 21:10 YuriFLAG 阅读(184) 评论(0) 推荐(0)
摘要: Description Description There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins lef 阅读全文
posted @ 2019-12-21 21:08 YuriFLAG 阅读(172) 评论(0) 推荐(0)
摘要: Description Description There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there a 阅读全文
posted @ 2019-12-21 21:06 YuriFLAG 阅读(200) 评论(0) 推荐(0)
摘要: Description Description Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there 阅读全文
posted @ 2019-12-21 21:02 YuriFLAG 阅读(363) 评论(0) 推荐(0)
摘要: Description Description Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. Example Exam 阅读全文
posted @ 2019-12-21 20:59 YuriFLAG 阅读(199) 评论(0) 推荐(0)
摘要: Description Description A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 阅读全文
posted @ 2019-12-21 20:58 YuriFLAG 阅读(234) 评论(0) 推荐(0)
摘要: Description Description Given an array of integers, find a contiguous subarray which has the largest sum. The subarray should contain at least one num 阅读全文
posted @ 2019-12-21 20:54 YuriFLAG 阅读(223) 评论(0) 推荐(0)
摘要: Description Description Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all 阅读全文
posted @ 2019-12-21 20:49 YuriFLAG 阅读(233) 评论(0) 推荐(0)
摘要: Description Description Give an integer array,find the longest increasing continuous subsequence in this array. An increasing continuous subsequence: 阅读全文
posted @ 2019-12-21 20:44 YuriFLAG 阅读(145) 评论(0) 推荐(0)
摘要: Description Description An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e 阅读全文
posted @ 2019-12-21 20:35 YuriFLAG 阅读(227) 评论(0) 推荐(0)
摘要: Description Description Give two users' ordered online time series, and each section records the user's login time point x and offline time point y. F 阅读全文
posted @ 2019-12-21 20:29 YuriFLAG 阅读(156) 评论(0) 推荐(0)
摘要: Description Description Given n pieces of wood with length L[i] (integer array). Cut them into small pieces to guarantee you could have equal or more 阅读全文
posted @ 2019-12-21 20:23 YuriFLAG 阅读(277) 评论(0) 推荐(0)
摘要: Description Description Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the sta 阅读全文
posted @ 2019-12-21 20:19 YuriFLAG 阅读(288) 评论(0) 推荐(0)
摘要: Description Description Given an integer matrix A which has the following features : The numbers in adjacent positions are different. The matrix has n 阅读全文
posted @ 2019-12-21 19:54 YuriFLAG 阅读(212) 评论(0) 推荐(0)
摘要: Description Given n books and the i-th book has pages[i] pages. There are k persons to copy these books. These books list in a row and each person can 阅读全文
posted @ 2019-12-21 19:39 YuriFLAG 阅读(338) 评论(0) 推荐(0)
摘要: Description Description Given n books and each book has the same number of pages. There are k persons to copy these books and the i-th person needs ti 阅读全文
posted @ 2019-12-21 19:15 YuriFLAG 阅读(279) 评论(0) 推荐(0)
摘要: Description Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), guarantee that at least one duplicate num 阅读全文
posted @ 2019-12-21 19:03 YuriFLAG 阅读(146) 评论(0) 推荐(0)
摘要: Description Description Divide two integers without using multiplication, division and mod operator. If it will overflow(exceeding 32-bit signed integ 阅读全文
posted @ 2019-12-21 18:50 YuriFLAG 阅读(110) 评论(0) 推荐(0)
摘要: Description Given an array with positive and negative numbers, find the maximum average subarray which length should be greater or equal to given leng 阅读全文
posted @ 2019-12-21 16:58 YuriFLAG 阅读(138) 评论(0) 推荐(0)
摘要: Description Description Given an list interval, which are taking off and landing time of the flight. How many airplanes are there at most at the same 阅读全文
posted @ 2019-12-21 16:40 YuriFLAG 阅读(300) 评论(0) 推荐(0)
摘要: Description Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of con 阅读全文
posted @ 2019-12-21 16:36 YuriFLAG 阅读(282) 评论(0) 推荐(0)
摘要: Description Numbers keep coming, return the median of numbers at every time a new number added. Description Description Numbers keep coming, return th 阅读全文
posted @ 2019-12-21 16:21 YuriFLAG 阅读(213) 评论(0) 推荐(0)
摘要: Description Description Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of large 阅读全文
posted @ 2019-12-21 16:17 YuriFLAG 阅读(195) 评论(0) 推荐(0)
摘要: Description Description Given an integer array with no duplicates. A max tree building on this array is defined as follow: The root is the maximum num 阅读全文
posted @ 2019-12-21 15:59 YuriFLAG 阅读(471) 评论(0) 推荐(0)
摘要: Description Description Given a 2D boolean matrix filled with False and True, find the largest rectangle containing all True and return its area. Exam 阅读全文
posted @ 2019-12-21 15:55 YuriFLAG 阅读(127) 评论(0) 推荐(0)
摘要: Description Description Given n x m non-negative integers representing an elevation map 2d where the area of each cell is 1 x 1, compute how much wate 阅读全文
posted @ 2019-12-21 15:52 YuriFLAG 阅读(182) 评论(0) 推荐(0)
摘要: Description Description Given an array of n integer, and a moving window(size k), move the window at each iteration from the start of the array, find 阅读全文
posted @ 2019-12-21 15:46 YuriFLAG 阅读(251) 评论(0) 推荐(0)
摘要: Description Description Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is abl 阅读全文
posted @ 2019-12-21 15:10 YuriFLAG 阅读(117) 评论(0) 推荐(0)
摘要: Description Given an expression s contains numbers, letters and brackets. Number represents the number of repetitions inside the brackets(can be a str 阅读全文
posted @ 2019-12-21 15:05 YuriFLAG 阅读(234) 评论(0) 推荐(0)
摘要: Given a matrix of lower alphabets and a dictionary. Find all words in the dictionary that can be found in the matrix. A word can start from any positi 阅读全文
posted @ 2019-12-21 11:14 YuriFLAG 阅读(324) 评论(0) 推荐(0)
摘要: Description Given a list of Connections, which is the Connection class (the city name at both ends of the edge and a cost between them), find edges th 阅读全文
posted @ 2019-12-21 11:05 YuriFLAG 阅读(263) 评论(0) 推荐(0)
摘要: Given a n,m which means the row and column of the 2D matrix and an array of pair A( size k). Originally, the 2D matrix is all 0 which means there is o 阅读全文
posted @ 2019-12-21 10:16 YuriFLAG 阅读(300) 评论(0) 推荐(0)