Cpp, Cplusplus, Programming, Software Development, Interview Questions.
: {Dir{-1,0}, Dir{1,0}, Dir{0,-1}, Dir{0,1}}) { if (!in_bounds(current,dir)) continue; if (is_empty(current,dir) && can_step(current,dir,false)) { q.push(Pos{current.row+dir.row, current.col+dir.col, current.k, current.distance+1}); // Mark as visited search[current.row+dir.row]