Interview Puzzles :: Discussion
Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge?
No Best Answer on this question yet!
Asked In : Sapient
Vikas Kumar Singh
28 Aug, 2018 5:35 AM
a=1 minute b=2 minute c=7 minute and d= 10 minute
Firstly a and b will go, so 2 minutes it will take then a will return it will take 1 more minute so total 3 minutes.
Now c and d will go so total time= 10 minutes and b will return so total time = 12 minutes
now again a and b will go so total time= 2 minutes
so complete total time=17 minutes is the final answer.
Only one torchlight is there and it should be with the 2 persons who are crossing the bridge so this algorithm needs to be followed.
16 Mar, 2018 5:43 PM
If 1 & 2 go and 1 come back then it is 3 mins, then 7 & 10 go (additional 10 mins) and 2 come back (add 2 min) then 1 & 2 go so additional 2 mins. Total 17 mins that's the lowest time. Herer we have a restriction that they have to share the same torchlight and one cant cross the bridge leaving the other on the bridge, that's why keeping in mind that two people will move together we will take the max time of two's