摘要: Reverse a linked list. For linked list 1->2->3, the reversed linked list is 3->2->1 /** * Definition for ListNode. * public class ListNode { * int val 阅读全文
posted @ 2016-03-06 10:37 哥布林工程师 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer. Returns 0 when the reversed integer overflows (signed 32-bit integer). Given x = 123, return 321 Given x = -123, return  阅读全文
posted @ 2016-03-06 10:16 哥布林工程师 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the nth node from the end of list and return its head. Given linked list: 1->2->3->4->5->null, and n = 2. After removing t 阅读全文
posted @ 2016-03-06 10:00 哥布林工程师 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all occurrences of that value in place and return the new length. The order of elements can be changed, and the ele 阅读全文
posted @ 2016-03-06 09:53 哥布林工程师 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2 阅读全文
posted @ 2016-03-06 09:19 哥布林工程师 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Remove Duplicates":What if duplicates are allowed at most twice? For example,Given sorted array A = [1,1,1,2,2,3], Your function should 阅读全文
posted @ 2016-03-06 09:09 哥布林工程师 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2016-03-06 07:47 哥布林工程师 阅读(111) 评论(0) 推荐(0) 编辑