title: Given a set of activities, which have associated weights, choose the set of non-overlapping activities that will maximize the total weight
body: <p>I have been thinking and searching for the solution of this problem,found this on <a href="https://en.wikipedia.org/wiki/Activity_selection_problem#Weighted_Activity_Selection_Problem" rel="nofollow noreferrer">wikipedia</a></p>
  
  <p>The solution proposes that find the activity with finish time &lt;= start time for i.
  But,consider this example:</p>
  
  <p>starting-time:[1,2,3,4,5]</p>
  
  <p>ending-time:[3,4,5,6,7]</p>
  
  <p>respective-weight:[13,5,2,4,1]</p>
  
  <p>For this example,when I am on activity:(4-6),I will be having 2 activities whose finishing time is less than 4,so,instead of just searching for a number through binary search,shouldn't we return an array and then take the max, value from it.</p>
  
  <p>Please correct me if I misunderstood the concept.</p>