随笔分类 -  LeetCode

上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 61 下一页
摘要:The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文
posted @ 2016-03-14 11:32 Grandyang 阅读(23640) 评论(9) 推荐(2) 编辑
摘要:  Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] 阅读全文
posted @ 2016-03-13 15:00 Grandyang 阅读(22792) 评论(0) 推荐(2) 编辑
摘要: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., there is only one bla 阅读全文
posted @ 2016-03-12 15:05 Grandyang 阅读(10876) 评论(9) 推荐(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 @ 2016-03-11 14:46 Grandyang 阅读(15199) 评论(7) 推荐(0) 编辑
摘要:Write a function to generate the generalized abbreviations of a word. Note: The order of the output does not matter. Example: Input: "word" Output: [" 阅读全文
posted @ 2016-03-10 13:29 Grandyang 阅读(13469) 评论(5) 推荐(1) 编辑
摘要: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 make 阅读全文
posted @ 2016-03-09 13:56 Grandyang 阅读(30049) 评论(8) 推荐(0) 编辑
摘要:Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any 阅读全文
posted @ 2016-03-08 05:14 Grandyang 阅读(16001) 评论(3) 推荐(0) 编辑
摘要:There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-empty word 阅读全文
posted @ 2016-03-07 13:35 Grandyang 阅读(28675) 评论(16) 推荐(0) 编辑
摘要:Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target. Note: Given target value is a floati 阅读全文
posted @ 2016-03-06 14:32 Grandyang 阅读(18449) 评论(3) 推荐(1) 编辑
摘要: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 @ 2016-03-05 13:58 Grandyang 阅读(55416) 评论(11) 推荐(1) 编辑
摘要:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all mee 阅读全文
posted @ 2016-03-04 07:13 Grandyang 阅读(24539) 评论(6) 推荐(0) 编辑
摘要:Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a floati 阅读全文
posted @ 2016-03-03 06:59 Grandyang 阅读(15128) 评论(0) 推荐(1) 编辑
摘要:Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + 阅读全文
posted @ 2016-03-02 15:16 Grandyang 阅读(15934) 评论(2) 推荐(1) 编辑
摘要:There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2016-03-01 15:31 Grandyang 阅读(16143) 评论(2) 推荐(1) 编辑
摘要: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 @ 2016-02-29 01:19 Grandyang 阅读(11986) 评论(7) 推荐(1) 编辑
摘要: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 @ 2016-02-28 15:51 Grandyang 阅读(10387) 评论(0) 推荐(0) 编辑
摘要:Given a string, determine if a permutation of the string could form a palindrome. Example 1: Example 2: Example 3: Hint: 这道题让我们判断一个字符串的全排列有没有是回文字符串的,那 阅读全文
posted @ 2016-02-27 17:29 Grandyang 阅读(10419) 评论(3) 推荐(0) 编辑
摘要:An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: a) it --> it (no abbrev 阅读全文
posted @ 2016-02-26 15:33 Grandyang 阅读(10771) 评论(0) 推荐(0) 编辑
摘要:You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres 阅读全文
posted @ 2016-02-25 14:17 Grandyang 阅读(8963) 评论(14) 推荐(1) 编辑
摘要:Given two 1d vectors, implement an iterator to return their elements alternately. Example: Follow up: What if you are given k 1d vectors? How well can 阅读全文
posted @ 2016-02-24 14:13 Grandyang 阅读(10736) 评论(4) 推荐(0) 编辑

上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 61 下一页
Fork me on GitHub