HashedIn by Deloitte interview question

Bridge and torch problem