You are given an N x N matrix in which every cell is colored black or white. Columns are numbered from 0 to N-1 (from left to right). This coloring is represented by a non-empty array of integers A. If the K-th number in the array is equal to X then the X lowest cells in the K-th column of the matrix are black. The rest of the cells in the K-th column are white.
Examples:
1. Given A = [1, 2, 5, 3, 1, 3], the function should return 2. For example, the black square of side 2 contains the two lowest rows of the 1st and 2nd columns (counting from 0).
Answers
Answered by
0
Explanation:
Agriculture can be called the backbone of India's economic system because two-thirds of the Indian population is engaged in the cultivation of land. Agriculture not only helps to feed the large population, but it also supports the principal manufacturing industries with raw materials.
Similar questions