摘要: Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. 阅读全文
posted @ 2017-05-18 23:19 JeffLai 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2017-05-18 23:04 JeffLai 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2017-05-18 22:52 JeffLai 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals. 阅读全文
posted @ 2017-05-18 21:02 JeffLai 阅读(101) 评论(0) 推荐(0) 编辑