Stalactites hang from the ceiling of a cave while stalagmites grow from the floor.
Create a function that determines whether the input represents "stalactites" or "stalagmites". If it represents both, return "both". Input will be a 2D list, with 1 representing a piece of rock, and 0 representing air space.
mineral_formation([
[0, 1, 0, 1],
[0, 1, 0, 1],
[0, 0, 0, 1],
[0, 0, 0, 0]
]) ➞ "stalactites"
mineral_formation([
[0, 0, 0, 0],
[0, 1, 0, 1],
[0, 1, 1, 1],
[0, 1, 1, 1]
]) ➞ "stalagmites"
mineral_formation([
[1, 0, 1, 0],
[1, 1, 0, 1],
[0, 1, 1, 1],
[0, 1, 1, 1]
]) ➞ "both"
"stalactites". If the last list has 1s, return "stalagmites". If both have them, return "both".