摘要: 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). You are given a target va 阅读全文
posted @ 2016-03-11 23:49 水果拼盘武士G 阅读(738) 评论(0) 推荐(0) 编辑
摘要: 两种方法,随后贴代码。 阅读全文
posted @ 2016-03-10 23:47 水果拼盘武士G 阅读(94) 评论(0) 推荐(0) 编辑
摘要: test3 阅读全文
posted @ 2016-03-09 23:52 水果拼盘武士G 阅读(86) 评论(0) 推荐(0) 编辑
摘要: test 阅读全文
posted @ 2016-03-08 23:48 水果拼盘武士G 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. AC代码: class Solution(object): def divi 阅读全文
posted @ 2016-03-07 23:34 水果拼盘武士G 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. AC代码: class Solution(obj 阅读全文
posted @ 2016-03-06 23:23 水果拼盘武士G 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't ma 阅读全文
posted @ 2016-03-05 22:31 水果拼盘武士G 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2016-03-04 21:03 水果拼盘武士G 阅读(670) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文
posted @ 2016-03-03 23:54 水果拼盘武士G 阅读(135) 评论(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-03-02 23:54 水果拼盘武士G 阅读(166) 评论(0) 推荐(0) 编辑