given the fully functioned largest_at_position and longest_chain.
Do not use any imports, do not use dictionaries
Extracted text: - def longest_chatn(lst): result - [] while(i < len(lst)="" and="" ist[t]="1):" result.append(lst[1])="" i="" +="" 1="" return="" sur="" (result)="" -="" def="" largest_at_postion(m,="" x,="" y):="" x_nax="longest_chain(n[x][y:]);" result="" -="" x_max="" while(i="">< len(m)="" and="" m[t][y]="=" 1):="" x_nax="" -="" i="" (longest="" chaln(m[tjty:]),="" x_nax)="" result="na" (result,="" x_max="" (t-x+1))="" return="" result="" if="" name="" casei="" main="" [[1,0,1,0,01,="" [1,0,1,1,1],="" [1,1,1,1,1],="" [1,0,0,1,0]]="" print(largest_at_position(case1,="" 0,="" 0))="" print(largest_at_postion(case1,="" 2,="" 0))="" print(largest_="" at_position(case1,="" 1,="">
Extracted text: def largest in_matrix(matrix: list[list[int]]) -> int: Returns the area of the largest rectangle in
. The area of a rectangle is defined by number of 1's that it contains. Again, you MUST make use of the helper here. If you managed to code correctly, this function should be simple to implement. Similarly, do not modify (i.e., mutate) the input matrix. Precondition: will only contain the integers 1 and 0. >>> case1 = [[1, 0, 1, 0, 0], [1, 0, 1, 1, 1], [1, 1, 1, 1, 1], [1, 0, 0, 1, 0]] >>> largest_in_matrix(case1) pass