上一页 1 2 3 4 5 6 ··· 8 下一页

2016年9月15日

1. Two Sum

摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文

posted @ 2016-09-15 12:31 三颗心 阅读(190) 评论(0) 推荐(0) 编辑

2016年9月14日

35. Search Insert Position

摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文

posted @ 2016-09-14 16:06 三颗心 阅读(653) 评论(0) 推荐(0) 编辑

121. Best Time to Buy and Sell Stock

摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文

posted @ 2016-09-14 12:36 三颗心 阅读(198) 评论(0) 推荐(0) 编辑

63. Unique Paths II

摘要: Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space 阅读全文

posted @ 2016-09-14 11:37 三颗心 阅读(170) 评论(0) 推荐(0) 编辑

2016年9月13日

147. Insertion Sort List

摘要: Sort a linked list using insertion sort. 用一个辅助指针来做表头避免处理改变head的时候的边界情况。 阅读全文

posted @ 2016-09-13 14:49 三颗心 阅读(176) 评论(0) 推荐(0) 编辑

143. Reorder List

摘要: 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-13 10:42 三颗心 阅读(375) 评论(0) 推荐(0) 编辑

2016年9月12日

82. Remove Duplicates from Sorted List II

摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2 阅读全文

posted @ 2016-09-12 22:42 三颗心 阅读(166) 评论(0) 推荐(0) 编辑

160. Intersection of Two Linked Lists

摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文

posted @ 2016-09-12 20:32 三颗心 阅读(171) 评论(0) 推荐(0) 编辑

142. Linked List Cycle II

摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you 阅读全文

posted @ 2016-09-12 19:49 三颗心 阅读(128) 评论(0) 推荐(0) 编辑

Search a 2D Matrix

摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文

posted @ 2016-09-12 19:20 三颗心 阅读(174) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 8 下一页

导航