Complete the function below. The function receives the full standard input as a single string and must return the exact standard output lines for the described problem.
Problem
Given an m x n matrix of characters '0' and '1', find the largest square containing only '1's and return its area.
Input
First line: two integers m n
Next m lines: each is a length-n string containing only 0/1
Output
A single integer: the maximal square area
Constraints
1 <= m, n <= 300
Examples
4 5
10100
10111
11111
10010
Output:
4
2 2
00
Output:
0
Example
Input
4 5
10100
10111
11111
10010
Output
4
Complete solveMaximalSquareArea. It has one parameter, String input, containing the full stdin payload. Return the stdout payload as an array of lines, without trailing newline characters.
input = "4 5\n10100\n10111\n11111\n10010" return = ["4"]
The returned string array must match the expected standard output lines for the sample input.
Use the limits and requirements stated in the prompt.
- Total Palindrome Substring CostOA · Seen Jun 2026
- Earliest Time All Users Are ConnectedPHONE SCREEN · Seen May 2026
- Tournament Rounds by RankPHONE SCREEN · Seen May 2026
- Farthest Seat AssignmentONSITE INTERVIEW · Seen May 2026
- Convex Function MinimizationPHONE SCREEN · Seen May 2026
- First Unique IP Hitting the ServerPHONE SCREEN · Seen May 2026
- Jump Game with Prime-Step RuleOA · Seen May 2026
- Pipeline Throughput Maximization Under BudgetOA · Seen May 2026
public String[] solveMaximalSquareArea(String input) {
// write your code here
}