• + 0 comments

    seanlangbrown's example would always result in killtheworld even though the problem stated so.

    We can prove by going through the first iteration the statement is incorrect: - Before entering the function: score = 0, step = 1, energy = 0 - First if statement is skipped because step != N - When way == 1, then score = 1, but energy = 0, so it goes straight to Killtheworld - When way == 2, then energy = 0, but because energy is still 0, it goes to Killtheworld

    Unless the statement is in regard to the testing samples, I don't believe this statement holds true for all scenarios.