
def createBlankGrid(row,column):
    blankgrid = [[0 for x in range(column)] for y in range(row)]
    
    return blankgrid

def getHeight(grid):
    return len(grid)

def getWidth(grid):
    return len(grid[0])

def printGrid(grid):
    numRow = len(grid)
    for i in range(0,numRow):
        row = grid[i]
        rowstr = ''
        for j in row:
            rowstr += str(j)+' '
        print(rowstr)

def serializeGrid(grid):
    numRow = len(grid)
    numCol = len(grid[0])
    gridstr = ''
    for j in range(0,numCol):
        for i in range(0,numRow):
            gridstr += str(grid[i][j])
    return gridstr
            


def createBlankGrid(row,column):
    blankgrid = [[0 for x in range(column)] for y in range(row)]
    
    return blankgrid

def getHeight(grid):
    return len(grid)

def getWidth(grid):
    return len(grid[0])

def printGrid(grid):
    numRow = len(grid)
    for i in range(0,numRow):
        row = grid[i]
        rowstr = ''
        for j in row:
            rowstr += str(j)+' '
        print(rowstr)

def serializeGrid(grid):
    numRow = len(grid)
    numCol = len(grid[0])
    gridstr = ''
    for j in range(0,numCol):
        for i in range(0,numRow):
            gridstr += str(grid[i][j])
    return gridstr

def setGrid(grid, setlist, rowoffset, coloffset):
    for entry in setlist:
        grid[entry[0]+rowoffset][entry[1]+coloffset] = 1
    return grid

def resetGrid(grid, setlist, rowoffset, coloffset):
    for entry in setlist:
        grid[entry[0]+rowoffset][entry[1]+coloffset] = 0
    return grid

Add setGrid and resetGrid functions
Add setGrid and resetGrid functions

  
  def createBlankGrid(row,column):
      blankgrid = [[0 for x in range(column)] for y in range(row)]
      
      return blankgrid
  
  def getHeight(grid):
      return len(grid)
  
  def getWidth(grid):
      return len(grid[0])
  
  def printGrid(grid):
      numRow = len(grid)
      for i in range(0,numRow):
          row = grid[i]
          rowstr = ''
          for j in row:
              rowstr += str(j)+' '
          print(rowstr)
  
  def serializeGrid(grid):
      numRow = len(grid)
      numCol = len(grid[0])
      gridstr = ''
      for j in range(0,numCol):
          for i in range(0,numRow):
              gridstr += str(grid[i][j])
      return gridstr
-             
  
+ def setGrid(grid, setlist, rowoffset, coloffset):
+     for entry in setlist:
+         grid[entry[0]+rowoffset][entry[1]+coloffset] = 1
+     return grid
+ 
+ def resetGrid(grid, setlist, rowoffset, coloffset):
+     for entry in setlist:
+         grid[entry[0]+rowoffset][entry[1]+coloffset] = 0
+     return grid
+ 
Add setGrid and resetGrid functions
## Code Before:

def createBlankGrid(row,column):
    blankgrid = [[0 for x in range(column)] for y in range(row)]
    
    return blankgrid

def getHeight(grid):
    return len(grid)

def getWidth(grid):
    return len(grid[0])

def printGrid(grid):
    numRow = len(grid)
    for i in range(0,numRow):
        row = grid[i]
        rowstr = ''
        for j in row:
            rowstr += str(j)+' '
        print(rowstr)

def serializeGrid(grid):
    numRow = len(grid)
    numCol = len(grid[0])
    gridstr = ''
    for j in range(0,numCol):
        for i in range(0,numRow):
            gridstr += str(grid[i][j])
    return gridstr
            

## Instruction:
Add setGrid and resetGrid functions
## Code After:

def createBlankGrid(row,column):
    blankgrid = [[0 for x in range(column)] for y in range(row)]
    
    return blankgrid

def getHeight(grid):
    return len(grid)

def getWidth(grid):
    return len(grid[0])

def printGrid(grid):
    numRow = len(grid)
    for i in range(0,numRow):
        row = grid[i]
        rowstr = ''
        for j in row:
            rowstr += str(j)+' '
        print(rowstr)

def serializeGrid(grid):
    numRow = len(grid)
    numCol = len(grid[0])
    gridstr = ''
    for j in range(0,numCol):
        for i in range(0,numRow):
            gridstr += str(grid[i][j])
    return gridstr

def setGrid(grid, setlist, rowoffset, coloffset):
    for entry in setlist:
        grid[entry[0]+rowoffset][entry[1]+coloffset] = 1
    return grid

def resetGrid(grid, setlist, rowoffset, coloffset):
    for entry in setlist:
        grid[entry[0]+rowoffset][entry[1]+coloffset] = 0
    return grid
