08 2015 档案

摘要:Problem:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thank... 阅读全文
posted @ 2015-08-31 22:23 airforce 阅读(190) 评论(0) 推荐(0)
摘要:Problem:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 3... 阅读全文
posted @ 2015-08-31 12:31 airforce 阅读(181) 评论(0) 推荐(0)
摘要:Problem:Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word o... 阅读全文
posted @ 2015-08-31 10:43 airforce 阅读(217) 评论(0) 推荐(0)
摘要:Problem:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be... 阅读全文
posted @ 2015-08-30 12:07 airforce 阅读(162) 评论(0) 推荐(0)
摘要:Problem:Given two words (beginWordandendWord), and a dictionary, find the length of shortest transformation sequence frombeginWordtoendWord, such that... 阅读全文
posted @ 2015-08-30 11:03 airforce 阅读(200) 评论(0) 推荐(0)
摘要:Problem:Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner a... 阅读全文
posted @ 2015-08-29 08:48 airforce 阅读(184) 评论(0) 推荐(0)
摘要:Problem:Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.Analysis:This... 阅读全文
posted @ 2015-08-29 01:26 airforce 阅读(226) 评论(0) 推荐(0)
摘要:Problem:Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequential... 阅读全文
posted @ 2015-08-28 23:55 airforce 阅读(216) 评论(0) 推荐(0)
摘要:Problem:There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have... 阅读全文
posted @ 2015-08-28 04:40 airforce 阅读(357) 评论(0) 推荐(0)
摘要:Problem:There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have... 阅读全文
posted @ 2015-08-28 04:04 airforce 阅读(223) 评论(0) 推荐(0)
摘要:Problem:Given an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two el... 阅读全文
posted @ 2015-08-27 23:47 airforce 阅读(284) 评论(0) 推荐(0)
摘要:Problem:Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have... 阅读全文
posted @ 2015-08-27 12:43 airforce 阅读(194) 评论(0) 推荐(0)
摘要:Problem:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded messa... 阅读全文
posted @ 2015-08-27 09:56 airforce 阅读(456) 评论(0) 推荐(0)
摘要:Problem:Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounde... 阅读全文
posted @ 2015-08-27 06:03 airforce 阅读(151) 评论(0) 推荐(0)
摘要:Problem:Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in th... 阅读全文
posted @ 2015-08-27 03:42 airforce 阅读(159) 评论(0) 推荐(0)
摘要:Problem:Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest fo... 阅读全文
posted @ 2015-08-26 12:09 airforce 阅读(142) 评论(0) 推荐(0)
摘要:Problem: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 us... 阅读全文
posted @ 2015-08-26 10:51 airforce 阅读(155) 评论(0) 推荐(0)
摘要:Problem:Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting a... 阅读全文
posted @ 2015-08-26 09:33 airforce 阅读(135) 评论(0) 推荐(0)
摘要:Problem:Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1,... 阅读全文
posted @ 2015-08-26 04:29 airforce 阅读(826) 评论(0) 推荐(0)
摘要:Problem:Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (incl... 阅读全文
posted @ 2015-08-26 02:53 airforce 阅读(192) 评论(0) 推荐(0)
摘要:Problem:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The ... 阅读全文
posted @ 2015-08-25 00:41 airforce 阅读(160) 评论(0) 推荐(0)
摘要:Problem:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADO... 阅读全文
posted @ 2015-08-24 23:28 airforce 阅读(171) 评论(0) 推荐(0)
摘要:Problem:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from ... 阅读全文
posted @ 2015-08-24 04:30 airforce 阅读(184) 评论(0) 推荐(0)
摘要:Problem:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted arraynums=[1,1,1,2,2,3],Your function s... 阅读全文
posted @ 2015-08-23 12:36 airforce 阅读(126) 评论(0) 推荐(0)
摘要:Problem:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For exam... 阅读全文
posted @ 2015-08-23 00:32 airforce 阅读(234) 评论(0) 推荐(0)
摘要:Problem:Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descen... 阅读全文
posted @ 2015-08-22 12:25 airforce 阅读(198) 评论(0) 推荐(0)
摘要:Problem:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following uni... 阅读全文
posted @ 2015-08-22 04:15 airforce 阅读(180) 评论(0) 推荐(0)
摘要:Problem:Find all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combination shoul... 阅读全文
posted @ 2015-08-22 01:07 airforce 阅读(170) 评论(0) 推荐(0)
摘要:Problem:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each... 阅读全文
posted @ 2015-08-21 23:49 airforce 阅读(156) 评论(0) 推荐(0)
摘要:Problem:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.link:https://leetco... 阅读全文
posted @ 2015-08-21 10:37 airforce 阅读(144) 评论(0) 推荐(0)
摘要:Problem:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequ... 阅读全文
posted @ 2015-08-21 06:10 airforce 阅读(232) 评论(0) 推荐(0)
摘要:Problem:https://leetcode.com/problems/substring-with-concatenation-of-all-words/You are given a string,s, and a list of words,words, that are all of t... 阅读全文
posted @ 2015-08-21 00:46 airforce 阅读(194) 评论(0) 推荐(0)