The time complexity of the Flood Fill algorithm should be O(m×n) , where m= no. of rows and n=no. of columns in the given matrix.
Note that every element of matrix is processed at most three times.
So, it boils down to O(3×mn), which eventually is same as O(mn).