Since the computer is not predictable, there's no guaranteed solution to this this puzzle. The best I can give are a few observation as to what strategies worked for me.
First of all, you want to gain squares that aren't exposed to empty spaces. If you leave your cells near an empty space, they can just be recaptured.