A much faster puzzle solution. USE STACK STRUCTURE