Solution for the problem Minesweeper Master that appeared in Qualification Round of Google-Code Jam 2014