05 2014 档案

摘要:Remove ElementGiven 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. ... 阅读全文
posted @ 2014-05-31 23:44 陆草纯 阅读(282) 评论(0) 推荐(0) 编辑
摘要:Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文
posted @ 2014-05-30 20:19 陆草纯 阅读(7211) 评论(4) 推荐(0) 编辑
摘要:Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up: Could you do this in-place?最简... 阅读全文
posted @ 2014-05-28 23:25 陆草纯 阅读(265) 评论(0) 推荐(0) 编辑
摘要:Surrounded RegionsGiven a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that... 阅读全文
posted @ 2014-05-27 15:21 陆草纯 阅读(3980) 评论(0) 推荐(0) 编辑
摘要:Implement strStr()Implement strStr().Returns a pointer to the first occurrence of needle in haystack, ornullif needle is not part of haystack.解法一:暴力解c... 阅读全文
posted @ 2014-05-26 21:58 陆草纯 阅读(4717) 评论(1) 推荐(0) 编辑
摘要:Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new len... 阅读全文
posted @ 2014-05-24 23:20 陆草纯 阅读(203) 评论(0) 推荐(0) 编辑
摘要:Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, wh... 阅读全文
posted @ 2014-05-23 13:42 陆草纯 阅读(2710) 评论(0) 推荐(0) 编辑
摘要:Decode WaysA message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded me... 阅读全文
posted @ 2014-05-20 20:19 陆草纯 阅读(442) 评论(0) 推荐(0) 编辑
摘要:Remove Duplicates from Sorted Array IIFollow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =... 阅读全文
posted @ 2014-05-19 19:38 陆草纯 阅读(1123) 评论(0) 推荐(0) 编辑
摘要:Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the... 阅读全文
posted @ 2014-05-14 22:38 陆草纯 阅读(6922) 评论(0) 推荐(1) 编辑
摘要:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解法一:使用unordered_map记录当前节点... 阅读全文
posted @ 2014-05-14 22:18 陆草纯 阅读(327) 评论(0) 推荐(0) 编辑
摘要:TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given... 阅读全文
posted @ 2014-05-12 22:58 陆草纯 阅读(295) 评论(0) 推荐(0) 编辑
摘要:Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to compl... 阅读全文
posted @ 2014-05-10 22:57 陆草纯 阅读(2537) 评论(0) 推荐(0) 编辑
摘要:Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi... 阅读全文
posted @ 2014-05-09 11:36 陆草纯 阅读(307) 评论(0) 推荐(0) 编辑
摘要:Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without u... 阅读全文
posted @ 2014-05-08 13:29 陆草纯 阅读(1581) 评论(0) 推荐(0) 编辑
摘要:Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo... 阅读全文
posted @ 2014-05-04 20:48 陆草纯 阅读(513) 评论(0) 推荐(0) 编辑
摘要:Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4... 阅读全文
posted @ 2014-05-02 16:39 陆草纯 阅读(1839) 评论(0) 推荐(0) 编辑
摘要:Sort ColorsGiven an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the or... 阅读全文
posted @ 2014-05-02 10:32 陆草纯 阅读(6837) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示