← All problemsSign in

Bounded Unbounded

Given a 2D array, where jth cell of ith row is 1 if it is occupied, else its 0. Print 1 if the geometrical figures formed by the occupied cell forms bounded areas, if any. Else print 0. Note: Diagonal movement allowed. Example: 1 1 1 1 0 1 1 1 1 is bounded cause the 0 is inside the 1's. Whereas, 1 1 0 1 0 1 1 1 1 is unbounded, cause you can reach the 0 from the outer 0. Constraints 1I

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