摘要: Given 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 two nu... 阅读全文
posted @ 2016-01-04 21:59 sdlwlxf 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2016-01-04 20:42 sdlwlxf 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is1 -> 2 -> 3 -> ... 阅读全文
posted @ 2016-01-04 20:33 sdlwlxf 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文
posted @ 2016-01-04 20:24 sdlwlxf 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文
posted @ 2016-01-04 20:21 sdlwlxf 阅读(150) 评论(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 @ 2016-01-04 20:07 sdlwlxf 阅读(128) 评论(0) 推荐(0) 编辑