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, 21.06.2019 23:30
Step 1: choose your topics review the project milestone reflections you submitted for modules 1 through 4. choose the one major idea or concept from each module that you feel most applies to your life. in addition, choose an important concept from module 5 that applies to your life. step 2: write your guidebook for each module: write a catchy headline that clearly and concisely sums up your chosen idea or concept write a brief explanation that includes a description of the concept, why it is important, and how it can be applied to your life to make a positive impact choose an exciting, powerful, or engaging image that illustrates your concept remember, you are writing one for each module, so you will have a total of five headlines, five descriptions, and five images. step 3: design your guidebook choose a format to present your digital guidebook. there are many 21st century tools available for creating and submitting your work in the online environment. for more information on tools your school uses, contact your instructor or visit the web 2.0 tools area.
Answers: 3
question
Computers and Technology, 22.06.2019 10:40
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
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
Physics, 07.12.2021 06:00
question
Health, 07.12.2021 06:00
question
Mathematics, 07.12.2021 06:00
question
Mathematics, 07.12.2021 06:00
question
History, 07.12.2021 06:00
question
Biology, 07.12.2021 06:00
question
Chemistry, 07.12.2021 06:00
Questions on the website: 13722363