摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if you are able to reach the last index.For example:A = [2,3,1,1,4], return true.A = [3,2,1,0,4], return fals 阅读全文
posted @ 2012-09-13 22:18 ETCOW 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 1 static string[] D1 = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX" }; 2 static string[] D1 阅读全文
posted @ 2012-09-13 22:06 ETCOW 阅读(389) 评论(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.Example 1:Given intervals [1,3],[6,9], insert and merge [2,5] in as [1,5],[6,9].Example 2:Given [1,2],[3,5],[ 阅读全文
posted @ 2012-09-13 22:00 ETCOW 阅读(622) 评论(0) 推荐(0) 编辑