Cpp, Cplusplus, Programming, Software Development, Interview Questions.
dir, bool remove) { if (remove) { // already removed k obstacles if (pos.k == k) return false; // this is not an obstacle if (grid[pos.row+dir.row][pos.col+dir.col] != 1) return false; // already visited if (search[pos.row+dir.row][pos.col+dir.col][pos.k+1]) return false; } else { // this is not an