Write a program that solves a word search puzzle as quickly and efficiently as possible.