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 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
What is one potential problem associated with an organization purchasing new technology early in its lifecycle
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
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
Mathematics, 03.02.2021 20:00
question
Mathematics, 03.02.2021 20:00
question
Biology, 03.02.2021 20:00
Questions on the website: 13722363