I have a Sudoku grid that is stored in a 1D vector. Here is an example of the board

Say, given a row and column, I want to find all values that are in its row, column, and 3x3 grid.

Using a for loop, I can do the following:

```
val row = 0
val col = 0 // We want to check for [0, 0]
for(i <- 0 to 8) {
if(myVector(i + row * 9) > 0) // do something
if(myVector(col + i * 9) > 0) // do something
}
```

This allows me to check for values in the row and column of [0, 0]. However, I cannot think of a formula to check the 3x3 grid for [0, 0]. Using that same loop with i valued 0 through 8, can anyone think of a way to check all values in its grid?

Thanks!