1652. Defuse the Bomb - Explanation

Problem Link