摘要:
The question:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?S... 阅读全文
摘要:
The question:Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a... 阅读全文
摘要:
The problem:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the ... 阅读全文
摘要:
The problem:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2... 阅读全文
摘要:
The problem:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the l... 阅读全文
摘要:
The problem:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways c... 阅读全文
摘要:
The problem:Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals we... 阅读全文
摘要:
The problem:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].My... 阅读全文
摘要:
---恢复内容开始---The problem:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that... 阅读全文
摘要:
The problem:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are ... 阅读全文