The scenario comprises of a wobbly bridge and four people. It is the night time and the people have only one torch. Without torch one may risk his life in crossing the bridge. Also we have a condition; the bridge is not quite strong and can hold only two persons together at one. The four people take different time to cross the bridge - 1 min, 2 min, 7 min and 10 min.
Since the torch is a necessity and the bride can't hold more than two persons at a time, two persons must travel at a time out of which one must return with the torch so they don't risk their life crossing in the dark.
What is the shortest time that will be required for all of them to cross the bridge?
Solution:
Were you thinking of using the fastest person who takes one minute to travel to and fro till everyone has reached the other end? Yes that can be done but it will take 10 + 1 + 7 + 1 + 2 = 21 minutes in total.
If we pay attention towards finding a way to merge the one taking 7 minutes and the one taking 10 minutes, we will have to acknowledge the fact that one of them will also have to return back which will take much more time than 21 minutes.
What if we use the person taking 2 minutes to escort the one taking 1 minutes across? Let's come to the conclusion:
1 and 2 cross the bridge
2 returns with the torch
7 and 10 cross the bridge
1 comes back
1 and 2 cross the bridge
In such a manner, the total time taken will be
2 + 2 + 10 + 1 + 2 = 17 minutes.