I couldn't think of good algorithm for finding how to fit spesific matrix(spaceship) in another matrix.

something like fitting this

** ** **++** **++** **++** ** ** (spaceship)

in this

.

Algorithm that I wrote considers the spaceship as rectangle, but I think it's not the right solution, as there can be cases which will fit the figure without corners. Any ideas?