Company: HackerEarth
Difficulty: medium
Imagine you are an avid gardener planning the layout of a large garden. You have to generate a 2D grid where each cell represents a plot in the garden. You can either plant a flower in a plot or leave it empty. After planting, you want to analyze the garden to find unique arrangements of flowers that form an "L" shape , as these arrangements are aesthetically pleasing and optimize space usage. A value of 1 in the grid indicates a plot where a flower is planted, and a value of 0 indicates an empty plot. An "L" shaped flower arrangement is defined as follows: A collection of 3 plots of the garden is said to be an L-shaped arrangement if one of its plots is in the same row as another plot and in the same column as the third plot. The 3 plots do not have to be next to each other. All three plots must contain flowers (value of 1 ). Grid generation The inputs provided are row , col , magicNumber and mod . row and col specify the size of the grid. To determine the presence of a flower in any