随笔分类 -  leetcode每题整理

1 2 3 4 5 ··· 8 下一页
摘要:题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum elemen... 阅读全文
posted @ 2015-01-12 04:29 爱做饭的小莹子 阅读(3236) 评论(0) 推荐(0) 编辑
摘要:题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique... 阅读全文
posted @ 2014-08-08 00:26 爱做饭的小莹子 阅读(4862) 评论(0) 推荐(0) 编辑
摘要:题目: Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see be... 阅读全文
posted @ 2014-08-07 10:29 爱做饭的小莹子 阅读(7926) 评论(0) 推荐(0) 编辑
摘要:题目:Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.题解:其实我觉得这题。。为啥不给个更明确... 阅读全文
posted @ 2014-08-07 10:20 爱做饭的小莹子 阅读(8715) 评论(0) 推荐(0) 编辑
摘要:题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not pos... 阅读全文
posted @ 2014-08-07 09:09 爱做饭的小莹子 阅读(5398) 评论(0) 推荐(0) 编辑
摘要:题目:The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following seque... 阅读全文
posted @ 2014-08-07 08:33 爱做饭的小莹子 阅读(5827) 评论(0) 推荐(0) 编辑
摘要:题目:Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You ... 阅读全文
posted @ 2014-08-07 05:25 爱做饭的小莹子 阅读(5186) 评论(0) 推荐(0) 编辑
摘要:题目:Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You ha... 阅读全文
posted @ 2014-08-07 04:51 爱做饭的小莹子 阅读(5083) 评论(0) 推荐(0) 编辑
摘要:题目:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible represent... 阅读全文
posted @ 2014-08-07 03:44 爱做饭的小莹子 阅读(2937) 评论(0) 推荐(0) 编辑
摘要:题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message... 阅读全文
posted @ 2014-08-07 03:15 爱做饭的小莹子 阅读(6336) 评论(0) 推荐(0) 编辑
摘要:题目:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", r... 阅读全文
posted @ 2014-08-07 02:40 爱做饭的小莹子 阅读(2956) 评论(0) 推荐(0) 编辑
摘要:题目:Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed fro... 阅读全文
posted @ 2014-08-07 01:48 爱做饭的小莹子 阅读(5070) 评论(0) 推荐(1) 编辑
摘要:题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.题解:这道题就是给你一个2D平面,然后给你的数据结构是由横纵坐标表示的点,然后看哪条直线上的点... 阅读全文
posted @ 2014-08-07 00:35 爱做饭的小莹子 阅读(2955) 评论(0) 推荐(0) 编辑
摘要:题目:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended fo... 阅读全文
posted @ 2014-08-06 03:37 爱做饭的小莹子 阅读(3499) 评论(0) 推荐(0) 编辑
摘要:题目:Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (includin... 阅读全文
posted @ 2014-08-06 03:25 爱做饭的小莹子 阅读(2769) 评论(0) 推荐(0) 编辑
摘要:题目:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding elem... 阅读全文
posted @ 2014-08-06 03:13 爱做饭的小莹子 阅读(5348) 评论(2) 推荐(1) 编辑
摘要:题目:Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can b... 阅读全文
posted @ 2014-08-06 00:04 爱做饭的小莹子 阅读(3847) 评论(0) 推荐(0) 编辑
摘要:题目:Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter... 阅读全文
posted @ 2014-08-05 23:46 爱做饭的小莹子 阅读(5345) 评论(2) 推荐(0) 编辑
摘要:题目:Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partition... 阅读全文
posted @ 2014-08-05 11:40 爱做饭的小莹子 阅读(5636) 评论(5) 推荐(2) 编辑
摘要:题目:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level ... 阅读全文
posted @ 2014-08-05 03:16 爱做饭的小莹子 阅读(3593) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 8 下一页
点击右上角即可分享
微信分享提示