Identifying set of longest time periods excluding overlapping time ranages
Your problem is known as weighted interval scheduling, and can be solved using dynamic programming. It's a nice exercise. You can find the solution in these lecture notes as well as in many other places.