subject

Given a square 2D list holding only 0's and 1's, determine the greatest number of 1's that can be covered by a square of smaller size. More formally, given an n x n 2D list in [row][col] order holding only 0's and 1's, and an integer k <= n, determine the greatest number of 1's that can be covered by a square of size k x k. Return a tuple with the number of 1's this optimal k x k square covers as the first element, the row of the top left corner of this optimal k x k square as the second element, and the col of the top left corner as the third element.

If several different k x k squares cover the same (maximum) number of 1's, return the row, col pair of the top left corner of the top left optimal placement, i. e., the placement for which row + col is smallest. There will not be a case where multiple optimal placements with the same row + col sum exist. If given k=0 or an empty 2D list, return 0 for the number of 1's covered, 0 for the row and 0 for the col.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
Given a square 2D list holding only 0's and 1's, determine the greatest number of 1's that can be co...
Questions
question
Chemistry, 25.10.2021 23:20
Questions on the website: 13722360