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 11:30
What do character formats do for your document's message? a.set the tone b.provide organization c.provide clarity d.set how texts align with documents
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 24.06.2019 10:30
This device directs network traffic. bridge hub nic repeater router switch
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
Questions on the website: 13722362