Determines if a given word is present in a board of NxN matrix.