Company: Flipkart_3sep
Difficulty: medium
Largest Square of 1s Problem Description Given a binary matrix of dimensions R x C , filled with elements 0 and 1, write a program to find the largest square containing only 1s and print its area. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the output and testcases will fail. Input Format: The first line of input contains two integers R and C separated by a single white space, where R is the number of rows and C is the number of columns. Next, R lines of input contain C 0s or 1s each. Output Format: Output contains the area of the largest square which has only 1s. Examples Example 1: Input: 4 4 0011 1011 0100 1010 Output: 4 Explanation: R = 4 and C = 4. The input matrix is given below and the largest square of 1s is highlighted. The area of this 2x2 square is 4. 0 0 1 1 1 0 1 1 0 1 0 0 1 0 1 0 Constraints 2 <= R, C <= 1000 ```