input: Write a python function named smallest_rectangle that takes a 2D list of integers (grid) and returns the area of the smallest rectangle containing all the 1's. 
  
  Example:
  >>> grid = [[0,1,0],[1,0,1]]
  6
  >>> grid = [[1,0],[0,0]]
  1
  
  Constraints:
  1 <= len(grid), len(grid[0]) <= 1000
  grid[i][j] is either 0 or 1.
  At least one 1 is present in the grid.
output: def smallest_rectangle(grid):
      rows = len(grid)
      cols = len(grid[0])
      min_row, max_row = rows, 0
      min_col, max_col = cols, 0
      
      for i in range(rows):
          for j in range(cols):
              if grid[i][j] == 1:
                  min_row = min(min_row, i)
                  max_row = max(max_row, i)
                  min_col = min(min_col, j)
                  max_col = max(max_col, j)
      
      if min_row > max_row or min_col > max_col:
          return 0
      return (max_row - min_row + 1) * (max_col - min_col + 1)