**This was asked in coding test of Cisco and nference**

Given the start time, duration and values of ‘n’ different people, calculate the maximum value by adding the values of different people together. the values of 2 people can be added if their starting and ending time do not overlap.

Input: start[]={1,3,4}

duration[]={1,2,2}

value[]={2,3,1}

Output: 5

Exp: if we start with person1 , we have total value as 2. it ends at 2, so it does not overlap with 2 or 3. if we take 2, the total value is 5 & for the case of 3,its 3. So the maximum value is 5.

I couldn’t solve the problem and hence ask my community for help. its kind of knapsack but overlapping thing is confusing me