Amazon Interview Question

implement a seach model using bfs