You are given an m×n grid where each cell contains a digit 0–9. The problem has two phases: Phase 1 – Match Detection: Identify all horizontal and vertical runs of 3 or more consecutive identical digits. For each match, record it as [position, length] (or (value, count) pair). Output order:…