摘要: 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 陆草纯 阅读(2709) 评论(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 陆草纯 阅读(437) 评论(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 陆草纯 阅读(1122) 评论(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 陆草纯 阅读(6917) 评论(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 陆草纯 阅读(326) 评论(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 陆草纯 阅读(293) 评论(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 陆草纯 阅读(2536) 评论(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 陆草纯 阅读(305) 评论(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 陆草纯 阅读(1578) 评论(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 陆草纯 阅读(512) 评论(0) 推荐(0) 编辑