Microsoft Interview Question

Find out all strings from a grid and compare with a list, traversal is random