An integer H (1 ≤ H ≤ 500), representing some quantity or size.
An integer W (1 ≤ W ≤ 500), representing some quantity or size.
A grid of integers of size HxW, where each integer is between 0 and 9.

### Example Input:

```
2 3
1 2 3
0 1 1
```

### Function Signature:
Write a function f(H, W, grid) that takes in the input.
def f(H: int, W: int, grid: List[List[int]]):
    '''
    H: an integer
    W: an integer
    grid: a list of lists of integers
    '''