摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 ... 阅读全文
posted @ 2015-06-05 23:53 TonyLuis 阅读(180) 评论(0) 推荐(0)
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文
posted @ 2015-06-05 23:43 TonyLuis 阅读(192) 评论(0) 推荐(0)
摘要: Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 num2[i]) return 1; else if(num1[i]<num... 阅读全文
posted @ 2015-06-05 20:45 TonyLuis 阅读(316) 评论(0) 推荐(0)
摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
posted @ 2015-06-05 19:20 TonyLuis 阅读(551) 评论(0) 推荐(0)
摘要: A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index... 阅读全文
posted @ 2015-06-05 17:47 TonyLuis 阅读(314) 评论(0) 推荐(0)
摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists: A: ... 阅读全文
posted @ 2015-06-05 17:19 TonyLuis 阅读(337) 评论(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() -- Remov... 阅读全文
posted @ 2015-06-05 17:04 TonyLuis 阅读(191) 评论(0) 推荐(0)
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.Th... 阅读全文
posted @ 2015-06-05 16:49 TonyLuis 阅读(190) 评论(0) 推荐(0)
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.Yo... 阅读全文
posted @ 2015-06-05 16:30 TonyLuis 阅读(209) 评论(0) 推荐(0)
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t... 阅读全文
posted @ 2015-06-05 11:51 TonyLuis 阅读(225) 评论(0) 推荐(0)
摘要: Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the".解题思路:本题方法多多,最简单的方式直接按“ ” spil... 阅读全文
posted @ 2015-06-05 10:23 TonyLuis 阅读(235) 评论(0) 推荐(0)
摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another ex... 阅读全文
posted @ 2015-06-05 09:55 TonyLuis 阅读(172) 评论(0) 推荐(0)