Count L-Shaped Plots
Problem Overview
- Count all L-shaped arrangements of three flower plots in a 2D grid where each involved cell is 1.
- Input: row, col, magicNumber, mod; grid values come from a modulus formula. Output: number of L shapes.
- An L uses one cell sharing a row with one and a column with another; cells need not be adjacent.
- Context: garden layout analysis on a generated grid.
- From Uber interviews; a classic coding interview problem and interview question.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
