Automatically solving the Flip puzzle (Breath-First-Search, optimizing memory use)