Foundations/A_Star_Search/solution.cpp
bool CheckValidCell(int x, int y, vector<vector<State>> &grid) {
  bool on_grid_x = (x >= 0 && x < grid.size());
  bool on_grid_y = (y >= 0 && y < grid[0].size());
  if (on_grid_x && on_grid_y)
    return grid[x][y] == State::kEmpty;
  return false;
}
/** 
 * Check that a cell is valid: on the grid, not an obstacle, and clear. 
 */
Check that a cell is valid: on the grid, not an obstacle, and clear.
Check that a cell is valid : on the grid not an obstacle and clear .
bool CheckValidCell(int x, int y, vector<vector<State>> &grid) {
  bool on_grid_x = (x >= 0 && x < grid.size());
  bool on_grid_y = (y >= 0 && y < grid[0].size());
  if (on_grid_x && on_grid_y)
    return grid[x][y] == State::kEmpty;
  return false;
}
bool CheckValidCell ( int x , int y , vector < vector < State > > & grid ) { bool on_grid_x = ( x >= 0 && x < grid . size ( ) ) ; bool on_grid_y = ( y >= 0 && y < grid [ 0 ] . size ( ) ) ; if ( on_grid_x && on_grid_y ) return grid [ x ] [ y ] == State :: kEmpty ; return false ; }
Check that a cell is valid: on the grid, not an obstacle, and clear.
Check that a cell is valid : on the grid not an obstacle and clear .