i want to see the solution of largest_at_positon. And also there is a restriction in first image. can ubalso show doctest in solutions? Thank you int:Returns the area of the largest rectangle whose...

i want to see the solution of largest_at_positon. And also there is a restriction in first image. can ubalso show doctest in solutions? Thank youMorkl le<br>AR DESTDICTION<br>lndey<br>2).py<br>2.py x<br>lab3.py x<br>lab5 (1).py x<br>lab6 (7).py x e lab7 (2).py X lab6 (5).py x<br>scratch_3<br>maximum_length = count<br>return maximum_length<br>def largest_at_position(matrix: list[list[int]], row: int, col: int) -> int:<br>Returns the area of the largest rectangle whose top left corner is at<br>position <row>, <col> in <matrix>.<br>You MUST make use of the helper <longest_chain> here as you loop through<br>each row of the matrix. Do not modify (i.e., mutate) the input matrix.<br>>>> case1 = [[1, 0, 1, 0, 0],<br>[1, 0, 1, 1, 1],<br>[1, 1, 1, 1, 1],<br>[1, 0, 0, 1, 0]]<br>>>> largest_at_position(case1, 0, 0)<br>4<br>>>> largest_at_position (case1, 2, 0)<br>>>> largest_at_position (case1, 1, 2)<br>6<br>pass<br>edef largest_in_matrix(matrix: list[list[int]]) -> int:<br>largest_in_matrix()<br>

Extracted text: Morkl le AR DESTDICTION lndey 2).py 2.py x lab3.py x lab5 (1).py x lab6 (7).py x e lab7 (2).py X lab6 (5).py x scratch_3 maximum_length = count return maximum_length def largest_at_position(matrix: list[list[int]], row: int, col: int) -> int: Returns the area of the largest rectangle whose top left corner is at position , in . You MUST make use of the helper here as you loop through each row of the matrix. Do not modify (i.e., mutate) the input matrix. >>> case1 = [[1, 0, 1, 0, 0], [1, 0, 1, 1, 1], [1, 1, 1, 1, 1], [1, 0, 0, 1, 0]] >>> largest_at_position(case1, 0, 0) 4 >>> largest_at_position (case1, 2, 0) >>> largest_at_position (case1, 1, 2) 6 pass edef largest_in_matrix(matrix: list[list[int]]) -> int: largest_in_matrix()
Morklle<br>lodoy<br>LAR DESTDI<br>2).py<br>lab3.py x<br>lab5 (1).py x<br>,lab6 (7).py x e lab7 (2).py x<br>-py X<br>lab6 (5).py x<br>scratch_3<br>LAB RESTRICTIONS, PLEASE READ:<br>Do not add any imports, the ones that you need will be given to you.<br>You may not use any dictionaries or dictionary methods.<br>Do not use try-except statements, you should be able to anticipate<br>or prevent any errors from happening at all!<br>def longest_chain(lst: list[int]) -> int:<br>Your longest_chain function from last week, make sure this works properly<br>before proceeding with the rest of the lab!<br>maximum_length = 0<br>i = 0<br>count = 0<br>while i < Len(Lst):<br>if lst[i] == 1;<br>Count += 1<br>else:<br>if count > maximum_length:<br>maximum_Length = count<br>Count = 0<br>i += 1<br>if count > maximum_Length:<br>maximum_Length = count<br>return maximum_length<br>largest_in_matrix()<br>Doctests in lab7 (2) x<br>坛 三小<br>« 7 A D ↑<br>Oms<br>/usr/local/bin/python3.9
O lab7 (2) Jargest ot neniti "/>
Extracted text: Morklle lodoy LAR DESTDI 2).py lab3.py x lab5 (1).py x ,lab6 (7).py x e lab7 (2).py x -py X lab6 (5).py x scratch_3 LAB RESTRICTIONS, PLEASE READ: Do not add any imports, the ones that you need will be given to you. You may not use any dictionaries or dictionary methods. Do not use try-except statements, you should be able to anticipate or prevent any errors from happening at all! def longest_chain(lst: list[int]) -> int: Your longest_chain function from last week, make sure this works properly before proceeding with the rest of the lab! maximum_length = 0 i = 0 count = 0 while i < len(lst):="" if="" lst[i]="=" 1;="" count="" +="1" else:="" if="" count=""> maximum_length: maximum_Length = count Count = 0 i += 1 if count > maximum_Length: maximum_Length = count return maximum_length largest_in_matrix() Doctests in lab7 (2) x 坛 三小 « 7 A D ↑ Oms /usr/local/bin/python3.9 "/Applications/PyCharm CE.a Tests failed: 4, passed: 2 of 6 tests - 0 ms O Test Results > O lab7 (2) Jargest ot neniti
Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here