随笔分类 - [LeetCode]
摘要: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...
阅读全文

浙公网安备 33010602011771号