摘要: here is a garden with N slots. In each slot, there is a flower. The N flowers will bloom one by one in N days. In each day, there will be exactly one 阅读全文
posted @ 2017-11-23 17:06 jxr041100 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W. If there is no such window in S that covers al 阅读全文
posted @ 2017-11-23 17:04 jxr041100 阅读(359) 评论(0) 推荐(0) 编辑
摘要: Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If 阅读全文
posted @ 2017-11-23 17:02 jxr041100 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Design an in-memory file system to simulate the following functions: ls: Given a path in string format. If it is a file path, return a list that only 阅读全文
posted @ 2017-11-23 17:01 jxr041100 阅读(225) 评论(0) 推荐(0) 编辑
摘要: LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But all work and no play makes Jac 阅读全文
posted @ 2017-11-23 16:59 jxr041100 阅读(115) 评论(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 @ 2017-11-23 16:57 jxr041100 阅读(196) 评论(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 @ 2017-11-23 16:56 jxr041100 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions: where we define that subarray ( 阅读全文
posted @ 2017-11-23 16:54 jxr041100 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and ri 阅读全文
posted @ 2017-11-23 16:53 jxr041100 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers fr 阅读全文
posted @ 2017-11-23 16:51 jxr041100 阅读(306) 评论(1) 推荐(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 @ 2017-11-23 16:49 jxr041100 阅读(115) 评论(0) 推荐(0) 编辑
摘要: You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos 阅读全文
posted @ 2017-11-23 16:48 jxr041100 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
posted @ 2017-11-23 16:46 jxr041100 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room 阅读全文
posted @ 2017-11-23 16:45 jxr041100 阅读(81) 评论(0) 推荐(0) 编辑
摘要: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
posted @ 2017-11-23 16:44 jxr041100 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2017-11-23 16:43 jxr041100 阅读(130) 评论(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 @ 2017-11-23 16:41 jxr041100 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequen 阅读全文
posted @ 2017-11-23 16:40 jxr041100 阅读(123) 评论(0) 推荐(0) 编辑
摘要: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu 阅读全文
posted @ 2017-11-23 16:38 jxr041100 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. Not 阅读全文
posted @ 2017-11-23 16:37 jxr041100 阅读(115) 评论(0) 推荐(0) 编辑