RedMane Technology interview question

Brain teaser was the bridge and torch problem