Cpp, Cplusplus, Programming, Software Development, Interview Questions.
empty space if (grid[pos.row+dir.row][pos.col+dir.col] != 0) return false; // already visited if (search[pos.row+dir.row][pos.col+dir.col][pos.k]) return false; } return true; }; // BFS std::queue<Pos> q; // start in {0,0} with zero removed obstacles q.push(Pos{0,0,0,0}); search[0][0][0] = true;