Determine whether a word exists in a letter grid | Atlassian Interview Question