摘要: leetcode -Single Number IIGiven an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should ... 阅读全文
posted @ 2015-08-18 16:22 cnblogshnj 阅读(95) 评论(0) 推荐(0) 编辑
摘要: leetcode -Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a li... 阅读全文
posted @ 2015-08-18 14:50 cnblogshnj 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ... 阅读全文
posted @ 2015-08-18 14:33 cnblogshnj 阅读(119) 评论(0) 推荐(0) 编辑
摘要: leetcode - Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The bracket... 阅读全文
posted @ 2015-08-17 18:03 cnblogshnj 阅读(115) 评论(0) 推荐(0) 编辑
摘要: leetcode -Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000,... 阅读全文
posted @ 2015-08-16 23:44 cnblogshnj 阅读(151) 评论(0) 推荐(0) 编辑
摘要: leetcode - String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a chal... 阅读全文
posted @ 2015-08-16 20:42 cnblogshnj 阅读(144) 评论(0) 推荐(0) 编辑
摘要: leetcode -Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky ... 阅读全文
posted @ 2015-08-16 11:51 cnblogshnj 阅读(137) 评论(0) 推荐(0) 编辑
摘要: leetcode -Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn... 阅读全文
posted @ 2015-07-31 23:36 cnblogshnj 阅读(123) 评论(0) 推荐(0) 编辑
摘要: leetcode -Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 ... 阅读全文
posted @ 2015-07-22 17:04 cnblogshnj 阅读(97) 评论(0) 推荐(0) 编辑
摘要: leetcode -Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definitio... 阅读全文
posted @ 2015-07-22 10:31 cnblogshnj 阅读(100) 评论(0) 推荐(0) 编辑