I think you could also solve it using Flood Fill
Algorithm, which is similar to your approach. Thank you for sharing!
I have no idea what Flood Fill algorithm is. Will take a look at it. Thanks
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.