摘要: Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assum 阅读全文
posted @ 2014-12-26 12:38 lilyfindjob 阅读(537) 评论(3) 推荐(0)
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2014-12-24 07:25 lilyfindjob 阅读(150) 评论(0) 推荐(0)
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文
posted @ 2014-12-22 14:01 lilyfindjob 阅读(93) 评论(0) 推荐(0)
摘要: Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co... 阅读全文
posted @ 2014-11-18 05:16 lilyfindjob 阅读(136) 评论(1) 推荐(0)
摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文
posted @ 2014-11-17 10:41 lilyfindjob 阅读(146) 评论(0) 推荐(0)
摘要: Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"1,java里string的函数split可以用... 阅读全文
posted @ 2014-11-16 04:07 lilyfindjob 阅读(128) 评论(0) 推荐(0)
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2014-11-15 08:44 lilyfindjob 阅读(143) 评论(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-11-14 06:55 lilyfindjob 阅读(264) 评论(0) 推荐(0)
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2014-11-11 05:04 lilyfindjob 阅读(223) 评论(0) 推荐(0)
摘要: Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe... 阅读全文
posted @ 2014-11-06 06:40 lilyfindjob 阅读(132) 评论(0) 推荐(0)