Length of longest connected 1âs in a Binary Grid
Given a grid of size N*M consists of 0 and 1 only, the task is to find the length of longest connected 1s in the given grid. We can only move to left, right, up or down from any current cell of the grid. Examples: Input: N = 3, M = 3, grid[][] = { {0, 0, 0}, {0, 1, 0}, {0, 0, 0} } Output: 1 Explanat