A leading food delivery platform is analyzing its service coverage in a city grid. The city is represented by two binary m × n matrices of the same dimensions: availability and users.
availability[i][j] = 1indicates a delivery driver (a "dasher") is available at coordinate(i, j).users[i][j] = 1indicates a customer is located at coordinate(i, j).
A user cluster is a group of one or more customers located in 1 cell that are connected 4-directionally (up, down, left, or right). Customers in cells that are only connected diagonally are not considered part of the same cluster.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected