POSTMAN Hiring Off-Campus | Find All Groups of Farmland Question | OA(2022)

Question · Posted Jun 2026

Problem Statement You are given an m × n binary matrix land where: 0 represents forest land. 1 represents farmland. A group of farmland forms a rectangular region consisting entirely of 1s. Each farmland group is: Rectangular in shape. Non-overlapping. Completely surrounded by forest (0) or matrix boundaries. Your task is to identify every farmland group and return its coordinates in the format: [r1, c1, r2, c2] Where: (r1, c1) = top-left corner (r2, c2) = bottom-right corner Return all ...

The full answer & interview discussion are available to premium members.

Log in Create a free account