摘要: 题目: 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 爱做饭的小莹子 阅读(7924) 评论(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 爱做饭的小莹子 阅读(8711) 评论(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 爱做饭的小莹子 阅读(5396) 评论(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 爱做饭的小莹子 阅读(5820) 评论(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 爱做饭的小莹子 阅读(5179) 评论(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 爱做饭的小莹子 阅读(5082) 评论(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 爱做饭的小莹子 阅读(2935) 评论(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 爱做饭的小莹子 阅读(6335) 评论(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 爱做饭的小莹子 阅读(2953) 评论(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 爱做饭的小莹子 阅读(5068) 评论(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 爱做饭的小莹子 阅读(2954) 评论(0) 推荐(0) 编辑