Minesweeper Master

There's gotta be a way to do this mathematically, but building a greedy
map and solving it didn't seem that hard before I started...