Braze interview question

Given a multi-dimensional array of numbers from 1-9, write a function that returns a multi-dimensional array where any consecutive numbers of at least length 3, get replaced with 0s. Numbers may be consecutive both horizontally or vertically.