摘要: Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 val2) return 1;20 if(val1<val2) return -1;... 阅读全文
posted @ 2016-01-04 23:04 0giant 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].首先题意理... 阅读全文
posted @ 2016-01-04 17:30 0giant 阅读(150) 评论(0) 推荐(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 @ 2016-01-04 16:19 0giant 阅读(141) 评论(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 @ 2016-01-04 14:24 0giant 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].Credits... 阅读全文
posted @ 2016-01-04 10:53 0giant 阅读(331) 评论(0) 推荐(0) 编辑