← All problemsSign in

TNP CHALLENGE 302

There are N buildings placed in a row and numbered from left to right starting from 0 to N-1. Some of the buildings contain bombs. When a bomb explodes it destroys the building in which it is contained along with its neighbouring buildings. ( i’th building’s neighbours will be (i+1) th and (i-1) th building, except for the end buildings, which will be having only one neighbour ) You are give

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start