Minesweeper (CodeEval) in python2.