Single Floor Apartment
CodeChefOpen on judge ↗
Chef had won a big lottery in Chefland’s biggest fair. He decided to buy a single-floor apartment. The apartment has rooms and corridors connecting them. The Apartment is represented in the 2D grid, where parts of rooms are represented by 1’s and corridors by 0’s. Here all the 1’s surrounded by 0’s or ends of the grid are considered as a single room. Example: 1 0 1 1 1 0 0 0 0 0 1 1 $\textbf
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.
Sign in to chat with the tutor and save your progress.
Sign in to start