Hey Leetcoders need your help in solving this problem asked by Google in Onsites,
# Problem Statement
Ronny is working on one Project that has to be finished within given deadline,
he has couple of friends who can help him in completing his project,
but every friend is having some limitation of time because they also want to do their own study,
There are 3 things associated with every Friend:
1) The day he/she will be available
2) How much time he/she can contribute in making project
3) cost of time for spreading negativity or positivity,
If person is spreading negativity then Project will take 2*Cost[person_negativity] more time,
If person is spreading positivity then Project will take Cost[person_positivity] * 1.5 less time,
Ronny cannot work on adjacent days,
Ronny can devote whole day to work,
# Questions:
1) We need to find whether Ronny will be able to complete the project on time or not.
# Follow Up:
2) Find the Minimum time(days/hours) Ronny will be able to complete the Project
Input:
Given the deadline for Project (deadLine) ,
Number of Friends (N),
3 values for (N) friends,Sample Input:
deadLine = 5 days
N = 2
2 0.5 -1
4 1 +3
Sample Output: YES
because Ronny can take help of 2nd friend on day 4 and get the project time reduced to 5 - 3*1.5 = 0.5,
Ronny can work for 0.5 days