摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.水题不解释,一A,... 阅读全文
posted @ 2014-06-09 20:39 SunshineAtNoon 阅读(158) 评论(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 mat... 阅读全文
posted @ 2014-06-09 20:30 SunshineAtNoon 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,... 阅读全文
posted @ 2014-06-09 19:41 SunshineAtNoon 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Among the large Wisconsin cattle ranchers, it is customary to brand cows with serial numbers to please the Accounting Department. The cow hands don't ... 阅读全文
posted @ 2014-05-22 11:34 SunshineAtNoon 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2014-05-20 20:11 SunshineAtNoon 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =... 阅读全文
posted @ 2014-05-19 20:30 SunshineAtNoon 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2014-05-18 22:58 SunshineAtNoon 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be ... 阅读全文
posted @ 2014-05-18 17:44 SunshineAtNoon 阅读(187) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
posted @ 2014-05-18 13:12 SunshineAtNoon 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2014-05-16 17:52 SunshineAtNoon 阅读(226) 评论(0) 推荐(0) 编辑