Algorithm · Uber · Medium
Pattern Matching in a Grid Medium · Topics · Company Tags · Hints You are given a 2‑D integer array grid of size m x n. Every cell contains one of three values: 1, 2, or 0. A valid pattern is a contiguous sequence of cells along a single diagonal (either top‑left to bottom‑right or bottom‑left to top‑right) where: The sequence must begin with the value 1. After the starting 1, the values strictly alternate between 2 and 0. You are allowed to start the pattern at any cell and…
Checking your access…