摘要: 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 @ 2014-03-27 23:48 OpenSoucre 阅读(113) 评论(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-03-27 18:36 OpenSoucre 阅读(115) 评论(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-03-27 18:10 OpenSoucre 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2014-03-27 17:20 OpenSoucre 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2014-03-27 15:44 OpenSoucre 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.题意是判断整数是不是回文串,第一个想法是将整数转换为字符串,但题目要求不能用额外的空间第二个想法是将数字反过来,比较两个数字是不是相等,但将两个数字反过... 阅读全文
posted @ 2014-03-27 14:04 OpenSoucre 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字共有7个,即I(1)、V(5)、X(10)、L(50)、C(100)、D(500... 阅读全文
posted @ 2014-03-27 11:47 OpenSoucre 阅读(210) 评论(0) 推荐(0) 编辑
摘要: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2014-03-27 11:01 OpenSoucre 阅读(180) 评论(0) 推荐(0) 编辑