Number Of Houses
CodeChefOpen on judge ↗
Given a binary matrix of G (1 or 0) of dimension M x N where each cell is either a part of a house or not. This is a top view of a locality from sky (birds eye). If a cell has the value 1 it is the part of house (particularly roof). You need to find number of houses in the locality. 0 represents a non roof/house region grass/trees/road etc. (Diagonal 1’s cannot be considered part of same house an
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