Problem : Link
Problem looks greedy to me !! But I can't find any way to solve it .
Most confusing line is "waiting time of a person who waits longest is minimized?"
Here waiting time means previous waiting time+new queue waiting time and waits longest consider by waiting time ?
"calculate the minimum waiting time for a person who waits the longest."
Here waiting time previous waiting time+new queue waiting time or new queue waiting time only ?
If anyone confused with my question , then please explain details forgot all the above. Anyone explain how to solution ?