PYTHON
matrix = [
[0,0,0,0,0],
[0,0,0,0,0],
[0,0,0,0,0],
[0,0,0,0,0],
[0,0,0,0,0],
]
def put_land(row, col):
print(put_land(0,0)) # returns 1,new island, bounds checking
print(put_land(1,1)) # returns 2, also a new island
print(put_land(1,0)) # returns 1,two previous now form a single
print(put_land(4,3)) # returns 2, new island, bounds checking
print(put_land(3,4)) # returns 3, new island, bounds checking