Datasets:

Modalities:
Image
Text
Formats:
parquet
Size:
< 1K
Tags:
code
Libraries:
Datasets
pandas
License:
File size: 507 Bytes
f7ba5f2
 
 
 
 
1
2
3
4
5
6
If a grid has only one row or one column, then it's impossible for every tree to be adjacent to two other trees, since the outermost tree(s) can only have one friend. The only exception is if the grid is initially empty, in which case the requirement is vacuously true.

Otherwise, for a grid with at least two rows and columns, notice that filling the entire grid with trees will always leave every tree with at least two friends.

[See David Harmeyer's solution video here.](https://youtu.be/aC0n8sB2BLs)