摘要:
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. 阅读全文
摘要:
Given a collection of intervals, merge all overlapping intervals. 阅读全文