Count Fertile Pyramids in a Land

Problem: Count Fertile Pyramids in a Land

Given an m x n binary matrix grid:

  • grid[i][j] = 1 means the cell is fertile land;
  • grid[i][j] = 0 means the cell is not fertile land.

A pyram...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: