摘要:
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). 阅读全文
摘要:
Given a list, rotate the list to the right by k places, where k is non-negative. 阅读全文
摘要:
一直对HTTP的东西就了解得不多,算是一点一点积累吧。分析比较一下长连接和短连接的区别。
HTTP的长连接和短连接实质上说的是TCP的长连接和短连接。 阅读全文
摘要:
Given n and k, return the kth permutation sequence. 阅读全文
摘要:
下午刚面了阿里实习一面,赶紧攒波经验。 阅读全文
摘要:
n个数字(0,1,…,n-1)形成一个圆圈,从数字0开始,每次从这个圆圈中删除第m个数字(第一个为当前数字本身,第二个为当前数字的下一个数字)。当一个数字删除后,从被删除数字的下一个继续删除第m个数字。求出在这个圆圈中剩下的最后一个数字。 阅读全文
摘要:
求出1 ~ 13的整数中1出现的次数,并算出100 ~ 1300的整数中1出现的次数?为此他特别数了一下1 ~ 13中包含1的数字有1、10、11、12、13因此共出现6次,但是对于后面问题他就没辙了。ACMer希望你们帮帮他,并把问题更加普遍化,可以很快的求出任意非负整数区间中1出现的次数。 阅读全文
摘要:
Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. 阅读全文
摘要:
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is defined as a character sequence consists of non-space characters only. 阅读全文
摘要:
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times. 阅读全文