摘要: 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 below 阅读全文
posted @ 2016-09-14 23:32 咖啡中不塌缩的方糖 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWord to endWord, s 阅读全文
posted @ 2016-09-14 23:03 咖啡中不塌缩的方糖 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters. The input string does not contain lea 阅读全文
posted @ 2016-09-14 13:22 咖啡中不塌缩的方糖 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2016-09-14 12:56 咖啡中不塌缩的方糖 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Description: Count the number of prime numbers less than a non-negative number, n. 埃拉托斯特尼筛法 阅读全文
posted @ 2016-09-14 05:52 咖啡中不塌缩的方糖 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a 阅读全文
posted @ 2016-09-14 05:45 咖啡中不塌缩的方糖 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
posted @ 2016-09-14 04:23 咖啡中不塌缩的方糖 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. BST 阅读全文
posted @ 2016-09-14 03:58 咖啡中不塌缩的方糖 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2016-09-14 03:12 咖啡中不塌缩的方糖 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
posted @ 2016-09-14 00:00 咖啡中不塌缩的方糖 阅读(152) 评论(0) 推荐(0) 编辑