Autodesk Interview Question

The question with array minipulation. The question with bfs.