摘要: Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5.Note:Given n will always be valid.Try to do this in one pas 阅读全文
posted @ 2013-06-05 10:10 冰点猎手 阅读(149) 评论(0) 推荐(0)
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]&qu 阅读全文
posted @ 2013-06-05 09:55 冰点猎手 阅读(135) 评论(0) 推荐(0)
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0.For example, given n = 2, return [0,1,3,2]. Its gray c 阅读全文
posted @ 2013-06-05 00:05 冰点猎手 阅读(151) 评论(0) 推荐(0)