Merge IntervalsMar 27 '12
Given a collection of intervals, merge all overlapping intervals.
For example,
Given
return
Given
[1,3],[2,6],[8,10],[15,18],return
[1,6],[8,10],[15,18].[1,3],[2,6],[8,10],[15,18],[1,6],[8,10],[15,18].1->2->3->3->4->4->5, return 1->2->5.1->1->1->2->3, return 2->3.' ', return the length of last word in the string."Hello World",5."A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindrome.[1,1,2],2, and A is now [1,2].1->2->3->4, you should return the list as 2->1->4->3.