Company: Flipkart_3sep
Difficulty: medium
Largest Square of 1s Problem Description You are given a binary matrix with R rows and C columns; every cell holds 0 or 1 . Find the largest square block of the matrix that contains only 1s, and print its area . A square block of side k is formed by k consecutive rows and k consecutive columns, and its area is k * k . (inferred -- the source says "square" without defining it; a square block is aligned with the rows and columns of the matrix.) Read the input from standard input and print the output to standard output. Do not print anything else, because every extra character becomes part of the output and the test will fail. Input Format R C a[1][1] a[1][2] ... a[1][C] ... a[R][1] a[R][2] ... a[R][C] The first line contains two integers R and C separated by a single space: the number of rows and the number of columns. Each of the next R lines contains C values, each 0 or 1 , separated by single spaces: one row of the matrix from left to right. Output Format Print a single integer: the a