Pergunta de entrevista da empresa Bloomberg

How would you find the minimum length of a path between 2 points in a maze of 2D array? How would you parse string by a space?