Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How can i make use of python program to solve this?

Bridge Crossing at Night puzzle: A group of five people, who have one flashlight,need to cross a rickety bridge at night. A maximum of three persons can cross the

bridge at one time, and any party that crosses(either two or three ) must have the flashlight with them. The flashlight must be walked back and forth; it cannot be

thrown. Person A takes 1.5minutes to cross the bridge,Person B takes 2minutes, Person C takes 4.25minutes, Person D takes 5minutes, and person E takes 9minutes.

At least, two persons must walk together at the slower person's pace

here is my math on solving it

--> indicates to while <-- indicates fro

--> A,B,C = takes 4.25mins

<--- A = takes 1.5mins

--> A,D,E = takes 9mins

therefore total time is 14.75mins

but how can i write a python program to solve it

There are no answers yet.
Be the first to answer this question.