Question: Please help me this question public static int [] [] smallestSubarray(int [][] array, int sum) It takes a rectangular array and returns a square-size subarray
Please help me this question
![Please help me this question public static int [] [] smallestSubarray(int [][]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2ea6063694_74366f2ea5fda5cb.jpg)
public static int [] [] smallestSubarray(int [][] array, int sum) It takes a rectangular array and returns a square-size subarray of it whose values have a sum that is equal or larger to sum. A subarray can't be smaller than 22. If there are more than one square-size subarrays that satisfy the requirements, the method must return the square that has the smallest size. If two or more equally-sized squares satisfy the requirements, it must return the square whose values have the highest sum. Assume that the sum has such a value that always warrants a solution (i.e. no need to check or worry about this)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
