Question: Given a 2D array populated by 1's or 0's, write a function in Python to determine the the longest chain of 1's , ideally using
Given a 2D array populated by 1's or 0's, write a function in Python to determine the the longest chain of 1's, ideally using DFS or BFS.
For example, running the function on the following matrix would return [[0,5],[1,5],[2,5],[1,4],[3,5]] (in any order).

Thank you in advance!
2 3 5 | U1001 610 110 DLT ||0|00|| || |||0|| G G = [[1,1,1,0,0,1) [0, 0.10 1, 1] [1,1,0,0,0,] [1,0,1,1,0,1]] 2 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
