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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Problem:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be...
阅读全文
摘要:Problem:Given two words (beginWordandendWord), and a dictionary, find the length of shortest transformation sequence frombeginWordtoendWord, such that...
阅读全文
摘要:Problem:Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner a...
阅读全文
摘要:Problem:Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.Analysis:This...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Problem:Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have...
阅读全文
摘要:Problem:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded messa...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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,...
阅读全文
摘要:Problem:Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (incl...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要:Problem:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For exam...
阅读全文
摘要: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...
阅读全文
摘要:Problem:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following uni...
阅读全文
摘要: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...
阅读全文
摘要:Problem:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each...
阅读全文
摘要:Problem:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.link:https://leetco...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文

浙公网安备 33010602011771号