Perform a flood fill on the image starting from the given pixel. (Note: Outputting modified grid to allow exact array validation against testcases).
[
[
[
1,
1,
1
],
[
1,
1,
0
],
[
1,
0,
1
]
],
1,
1,
2
][
[
2,
2,
2
],
[
2,
2,
0
],
[
2,
0,
1
]
][
[
[
0,
0,
0
],
[
0,
0,
0
]
],
0,
0,
0
][
[
0,
0,
0
],
[
0,
0,
0
]
][
[
[
1,
1,
1
],
[
1,
1,
1
],
[
1,
1,
1
]
],
0,
0,
2
][
[
2,
2,
2
],
[
2,
2,
2
],
[
2,
2,
2
]
]Sign in to Run Code and Submit