Longest straight run of one color in a grid

0
Remix

Given a grid of colors such as R, G and B, return the length of the longest line of cells with the same color, running horizontally, vertically or diagonally.

GoogleTechnical phone screenLast asked Aug 2026
No answer yet. Write the first one; the best answer gets endorsed.