← All problemsSign in

3905. Multi Source Flood Fill

LeetCodeArrayBreadth-First SearchMatrixOpen on judge ↗

You are given two integers n and m representing the number of rows and columns of a grid, respectively. You are also given a 2D integer array sources, where sources[i] = [ri, ci, color​​​​​​​i] indicates that the cell (ri, ci) is initially colored with colori. All other cells are initially uncolored and represented as 0. At each time step, every currently colored cell spreads its color to all ad

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start