Monday, September 7, 2015

Flood Fill : grafixMask – SRM 211 Div 1 from Topcoder

Here I was practicing the "Flood Fill" approach to solve a problem. For details, see below.

https://www.topcoder.com/community/data-science/data-science-tutorials/how-to-find-a-solution/#floodfill

Problem

This is the problem statement.
http://community.topcoder.com/stat?c=problem_statement&pm=2998&rd=5857

My Approach

Since this is a solvable problem with the "Flood Fill", I used BFS to search all reachable cells from every coordinate.

Here is my practice code at Github..

https://github.com/emoken/topcoder-study/blob/master/src/main/java/TopCoder/SRM211_DIV1/GrafixMask.java

No comments:

Post a Comment