上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页
摘要: 题目:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function shou... 阅读全文
posted @ 2014-08-04 10:56 爱做饭的小莹子 阅读(1704) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm... 阅读全文
posted @ 2014-08-04 10:30 爱做饭的小莹子 阅读(2881) 评论(1) 推荐(0) 编辑
摘要: 题目:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed f... 阅读全文
posted @ 2014-08-04 09:35 爱做饭的小莹子 阅读(15630) 评论(1) 推荐(3) 编辑
摘要: 题目:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution ... 阅读全文
posted @ 2014-08-04 08:55 爱做饭的小莹子 阅读(2232) 评论(0) 推荐(0) 编辑
摘要: 题目:Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".题解:二进制加法都是从最低位(从右加到左)。所以对两个字符串要从最后一位开始加,... 阅读全文
posted @ 2014-08-04 05:07 爱做饭的小莹子 阅读(4922) 评论(2) 推荐(0) 编辑
摘要: 题目:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total ... 阅读全文
posted @ 2014-08-04 03:52 爱做饭的小莹子 阅读(5383) 评论(0) 推荐(0) 编辑
摘要: 题目:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read ... 阅读全文
posted @ 2014-08-04 03:22 爱做饭的小莹子 阅读(5734) 评论(0) 推荐(0) 编辑
摘要: 题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes... 阅读全文
posted @ 2014-08-04 02:23 爱做饭的小莹子 阅读(3495) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lo... 阅读全文
posted @ 2014-08-04 02:08 爱做饭的小莹子 阅读(5497) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,... 阅读全文
posted @ 2014-08-03 09:18 爱做饭的小莹子 阅读(4980) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页